15 releases (9 breaking)

0.10.3+mc1.21.1 Oct 23, 2024
0.10.2 Jun 14, 2024
0.10.1 Apr 24, 2024
0.9.0 Dec 5, 2023
0.4.0 Nov 19, 2022

#870 in Parser implementations

Download history 58/week @ 2024-07-28 15/week @ 2024-08-04 12/week @ 2024-08-11 7/week @ 2024-08-18 14/week @ 2024-08-25 10/week @ 2024-09-01 8/week @ 2024-09-08 24/week @ 2024-09-15 47/week @ 2024-09-22 41/week @ 2024-09-29 3/week @ 2024-10-06 16/week @ 2024-10-13 207/week @ 2024-10-20 27/week @ 2024-10-27 42/week @ 2024-11-03 10/week @ 2024-11-10

287 downloads per month
Used in 7 crates (6 directly)

MIT license

290KB
5K SLoC

Azalea Chat

Things for working with Minecraft formatted text components.

Examples

// 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"
);

Dependencies

~1–2.3MB
~45K SLoC