pub struct ChatComponentObject {Show 14 fields
pub text: Option<String>,
pub translate: Option<String>,
pub keybind: Option<String>,
pub bold: Option<bool>,
pub italic: Option<bool>,
pub underlined: Option<bool>,
pub strikethrough: Option<bool>,
pub obfuscated: Option<bool>,
pub font: Option<String>,
pub color: Option<String>,
pub insertion: Option<String>,
pub click_event: Option<ChatClickEvent>,
pub hover_event: Option<ChatHoverEvent>,
pub extra: Option<Vec<ChatObject>>,
}
Expand description
A piece of a ChatObject
Fields§
§text: Option<String>
Text of the chat message
translate: Option<String>
Translation key if the message needs to pull from the language file. See wiki.vg
keybind: Option<String>
Displays the keybind for the specified key, or the string itself if unknown.
bold: Option<bool>
Should the text be rendered bold?
italic: Option<bool>
Should the text be rendered italic?
underlined: Option<bool>
Should the text be rendered underlined?
strikethrough: Option<bool>
Should the text be rendered as strikethrough
obfuscated: Option<bool>
Should the text be rendered as obfuscated? Switching randomly between characters of the same width
font: Option<String>
The font to use to render, comes in three options:
minecraft:uniform
- Unicode fontminecraft:alt
- enchanting table fontminecraft:default
- font based on resource pack (1.16+)
Any other value can be ignored
color: Option<String>
The color to display the chat item in. Can be a chat color, format code, or any valid web color
insertion: Option<String>
Text to insert into the chat box when shift-clicking this component
click_event: Option<ChatClickEvent>
Defines an event that occurs when this chat item is clicked
hover_event: Option<ChatHoverEvent>
Defines an event that occurs when this chat item is hovered on
extra: Option<Vec<ChatObject>>
Sibling components to this chat item. If present, will not be empty