Asi nbt
Use the nbt! macro from mc_protocol for creating NBT (Named Binary Tag) data for Minecraft protocol encoding.
install
source · Clone the upstream repo
git clone https://github.com/plurigrid/asi
Claude Code · Install into ~/.claude/skills/
T=$(mktemp -d) && git clone --depth=1 https://github.com/plurigrid/asi "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/nbt" ~/.claude/skills/plurigrid-asi-nbt && rm -rf "$T"
manifest:
skills/nbt/SKILL.mdsource content
NBT Encoding Skill
Use the
nbt! macro from mc_protocol for creating NBT data.
When to Use
Use this skill when you need to:
- Encode NBT data for Minecraft packets
- Create text components for chat, action bar, titles
- Build compound NBT structures
Basic Usage
use mc_protocol::nbt; // Simple compound let compound = nbt! { "text" => "Hello", "count" => 42i32, "flag" => true, }; // Convert to network bytes let bytes = compound.to_network_bytes();
Nested Compounds
use mc_protocol::nbt; let nested = nbt! { "outer" => nbt! { "inner" => 123i32, }, };
Supported Types
- Bytei8
- Shorti16
- Inti32
- Longi64
- Floatf32
- Doublef64
/&str
- StringString
- Byte (0 or 1)bool
- Nested compoundNbtCompound
- List of same-type elementsNbtList
Text Components (Chat/Action Bar)
For Minecraft text components (used in chat, action bar, titles):
use mc_protocol::nbt; // Simple text let text_component = nbt! { "text" => "Hello World", }; // With color let colored = nbt! { "text" => "Red text", "color" => "red", };
Best Practices
- Always use the
macro instead of manual byte manipulationnbt! - Use explicit type suffixes (
,42i32
) for numeric literals1.0f32 - Use
for protocol encoding (adds type tag, no root name)to_network_bytes()