Enum minecraft_json::minecraft::text::HoverEvent[][src]

pub enum HoverEvent {
    ShowText(ValueOrContents<Box<TextComponent>, Box<TextComponent>>),
    ShowItem(ValueOrContents<String, Item>),
    ShowEntity(ValueOrContents<LegacyEntity, Entity>),
}
Expand description

Event upon mouse hover on this text component.

assert_equiv!(
    r#"{"action":"show_text","contents":{"text":"hello"}}"#,
    HoverEvent::ShowText(ValueOrContents::Contents(
        Box::new(TextComponent::Text {
            text: StringLike::String("hello".into()),
            properties: TextComponentTags::default(),
        })
    ))
);

Variants

ShowText(ValueOrContents<Box<TextComponent>, Box<TextComponent>>)

Shows a raw JSON text component. value/contents can be any valid text component type. Note that clickEvent and hoverEvent do not function within the tooltip.

ShowItem(ValueOrContents<String, Item>)

Shows the tooltip of an item as if it was being hovering over it in an inventory.

ShowEntity(ValueOrContents<LegacyEntity, Entity>)

Shows an entity’s name, type, and UUID. Used by selector (see TextComponent::EntityNames).

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.