smithery.ai

nbt

Use the nbt! macro from mc_protocol for creating NBT (Named Binary Tag) data for Minecraft protocol encoding.

First seen Mar 20, 2026

Installation

$ npx skills add https://smithery.ai

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 1,557 B
  • docs SUMMARY.md 120 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

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 - Byte
  • i16 - Short
  • i32 - Int
  • i64 - Long
  • f32 - Float
  • f64 - Double
  • &str / String - String
  • bool - Byte (0 or 1)
  • NbtCompound - Nested compound
  • NbtList - 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

  1. Always use the nbt! macro instead of manual byte manipulation
  2. Use explicit type suffixes (42i32, 1.0f32) for numeric literals
  3. Use tonetworkbytes() for protocol encoding (adds type tag, no root name)