Agent skill
nbt
Use the nbt! macro from mc_protocol for creating NBT (Named Binary Tag) data for Minecraft protocol encoding.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/data/nbt
SKILL.md
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
i8- Bytei16- Shorti32- Inti64- Longf32- Floatf64- Double&str/String- Stringbool- Byte (0 or 1)NbtCompound- Nested compoundNbtList- List of same-type elements
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
nbt!macro instead of manual byte manipulation - Use explicit type suffixes (
42i32,1.0f32) for numeric literals - Use
to_network_bytes()for protocol encoding (adds type tag, no root name)
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?