← Back to list

nbt
by andrewgazelka
A high-performance Minecraft server with hot-reloadable plugins and flat, readable code.
⭐ 6🍴 0📅 Jan 22, 2026
SKILL.md
name: nbt description: Use the nbt! macro from mc_protocol for creating NBT (Named Binary Tag) data for Minecraft protocol encoding.
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)
Score
Total Score
50/100
Based on repository quality metrics
✓SKILL.md
SKILL.mdファイルが含まれている
+20
○LICENSE
ライセンスが設定されている
0/10
○説明文
100文字以上の説明がある
0/10
○人気
GitHub Stars 100以上
0/15
○最近の活動
3ヶ月以内に更新がある
0/10
○フォーク
10回以上フォークされている
0/5
✓Issue管理
オープンIssueが50未満
+5
✓言語
プログラミング言語が設定されている
+5
○タグ
1つ以上のタグが設定されている
0/5
Reviews
💬
Reviews coming soon