minecraft-chat
Minecraft chat are represented as json object. It's used in different packets. Information about format can be found at https://wiki.vg/Chat.
Usage
Add this to your Cargo.toml
:
[]
= "0.1"
Example
Serialize
use ;
let message = builder
.color
.bold
.then
.color
.bold
.italic
.then
.color
.build;
println!;
Deserialize
use ;
let json = r#"
{
"bold":true,
"color":"yellow",
"text":"Hello",
"extra":[
{
"bold":true,
"italic":true,
"color":"green",
"text":"world"
},
{
"color":"blue",
"text":"!"
}
]
}
"#;
let expected_message = builder
.color
.bold
.then
.color
.bold
.italic
.then
.color
.build;
assert_eq!;