| Crates.io | azalea-chat |
| lib.rs | azalea-chat |
| version | 0.13.0+mc1.21.5 |
| created_at | 2022-08-30 02:49:02.590266+00 |
| updated_at | 2025-06-16 00:23:48.346496+00 |
| description | Parse Minecraft chat messages. |
| homepage | |
| repository | https://github.com/azalea-rs/azalea |
| max_upload_size | |
| id | 654911 |
| size | 86,820 |
Things for working with Minecraft formatted text components.
// convert a Minecraft formatted text JSON into colored text that can be printed to the terminal.
use azalea_chat::FormattedText;
use serde_json::Value;
use serde::Deserialize;
let j: Value = serde_json::from_str(
r#"{"text": "hello","color": "red","bold": true}"#
)
.unwrap();
let text = FormattedText::deserialize(&j).unwrap();
assert_eq!(
text.to_ansi(),
"\u{1b}[1m\u{1b}[38;2;255;85;85mhello\u{1b}[m"
);