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
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]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 !=
.