Crate mc_chat

Source
Expand description

This crate provides Rust objects that map to the minecraft protocol raw JSON message format used for chat messages, books, titles…

§Serialization/Deserialization

Serialization and Deserialization is implemented using serde. Excluding a few rare cases (mainly the storage component and the separator field for SelectorComponent), all serialization and deserialization should happen correctly.

We plan on implementing legacy text soon!

§Contributing

Please check out our github and feel free to contribute.

This crate would need more testing, all help appreciated!!

Structs§

ChatComponent
The central building block of Minecraft’s JSON message format.
ComponentStyle
The style of a ChatComponent
KeybindComponent
ScoreComponent
SelectorComponent
TextComponent
TranslationComponent

Enums§

ChatColor
The different colors a ChatComponent can have.
ClickEvent
A ClickEvent useful in a chat message or book.
ComponentType
The different kinds of components Minecraft chat messages can be made up of. One component (storage-component, since 1.15) is missing, further research and contributions on this would be appreciated!
HoverEvent
A HoverEvent useful in a chat message or book.

Constants§

VERSION_1_7
The version number of the Minecraft protocol for 1.7
VERSION_1_8
The version number of the Minecraft protocol for 1.8
VERSION_1_15
The version number of the Minecraft protocol for 1.15
VERSION_1_16
The version number of the Minecraft protocol for 1.16