Back to 9Minecraft
Wiki 9Minecraft Wiki 9Minecraft
Data Api Data Pack Wiki › Guides › How to Add Custom NBT Tags to Items (Fireproofing, Right-Click Detection, Saturation)

How to Add Custom NBT Tags to Items (Fireproofing, Right-Click Detection, Saturation)

Where the Tags Go

The Data API Data Pack adds custom NBT tags you attach to items via /give or /summon. You write them inside the item's tag compound, usually under a custom namespace so they don't clash with vanilla data. The settings book (/function dev:settings) lists the exact tag names the pack recognizes — always check it rather than guessing, since tag names are case-sensitive.

Common Customizations

  • Fireproofing: add the fireproof tag so the item survives lava and fire instead of burning up.
  • Right-click detection: attach the right-click tag so the pack fires its detection logic when a player uses the item, letting you hook your own functions onto that event.
  • Custom saturation: set the saturation tag on a food item to control how much saturation it restores, independent of the vanilla hunger value.
  • Custom durability: give an item a durability value the pack tracks, useful for tools that aren't normally damageable.

Testing Your Item

After giving yourself the item, right-click it, drop it in fire, or eat it depending on which tag you set, and watch for the expected behavior. If nothing happens, re-open the settings book and confirm the tag name and expected value type (string vs. number). A single typo in the namespace or key will silently do nothing.