1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 14:26:04 +00:00
azalea/azalea-chat
mat e2945b90a9 Release 0.12.0
azalea@0.12.0
azalea-auth@0.12.0
azalea-block@0.12.0
azalea-block-macros@0.12.0
azalea-brigadier@0.12.0
azalea-buf@0.12.0
azalea-buf-macros@0.12.0
azalea-chat@0.12.0
azalea-client@0.12.0
azalea-core@0.12.0
azalea-crypto@0.12.0
azalea-entity@0.12.0
azalea-inventory@0.12.0
azalea-inventory-macros@0.12.0
azalea-language@0.12.0
azalea-physics@0.12.0
azalea-protocol@0.12.0
azalea-protocol-macros@0.12.0
azalea-registry@0.12.0
azalea-registry-macros@0.12.0
azalea-world@0.12.0

Generated by cargo-workspaces
2025-04-12 21:08:44 -05:00
..
src remove executable bit from files 2025-04-04 15:56:06 +00:00
tests remove executable bit from files 2025-04-04 15:56:06 +00:00
Cargo.toml Release 0.12.0 2025-04-12 21:08:44 -05:00
README.md remove executable bit from files 2025-04-04 15:56:06 +00:00

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