Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Nbt Api Plugin Wiki › Guides › Create a Custom Item with NBT Tags

Create a Custom Item with NBT Tags

Setting Up Your Custom Item

NBT tags allow you to add hidden data to items that control their behavior, appearance, and functionality. Use the NBT API to programmatically assign tags to items without manual editing.

Steps

1. Get the item you want to modify — Hold or reference the item in your inventory or as a drop.

2. Access the NBT compound — Use the API to retrieve the item's NBT data structure.

3. Add custom tags — Insert your desired tags (like CustomModelData, display, Enchantments, or custom tags) into the compound.

4. Set the modified NBT back — Apply the updated NBT data to the item.

5. Test in-game — Place the item in your inventory or on the ground to verify the changes took effect.

Tips

  • Use display tags to add custom names and lore without affecting the item's base properties.
  • Nested compounds (tags within tags) let you create complex data structures for advanced functionality.
  • Always validate your tag syntax to avoid corruption; malformed NBT can cause items to behave unexpectedly.
  • Check that your custom tags don't conflict with reserved Minecraft tags.