Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

NBT Component Changes

Shane Bee edited this page Apr 26, 2024 · 13 revisions

Minecraft 1.20.5 changed the structure of NBT for items, they introduced a component system which refactored the layout of where Item's store different datas.
You can read more about the Data Component Format on McWiki

NBT Compound Changes:

Due to the changes in with how Minecraft deals with NBT, the expression for getting an NBT compound has slightly changed.

NBT of Item:

Pattern: nbt of %item%

  • This syntax will now return everything in the Item's "minecraft:custom_data" component (see McWiki for more details).
  • This is where you will store all your custom data in an item.
  • This will not include any Minecraft specific data (ex: enchantments, attribute modifiers, damage, custom model data, etc).
  • Editing this NBT will directly update the item itself.
  • The main point of this change was to keep in line with Minecraft's old behaviour of returning the "tag" portion of an item's nbt, where you'd store all your custom data/tags.

Components NBT of Item:

Pattern: components nbt of %item%

  • This will return the "components" tag of an item's NBT.
  • This is where all Minecraft vanilla data is stored (ex: enchantments, attribute modifiers, damage, custom model data, etc).
  • You cannot create custom components here, all custom data will need to be stored within the "minecraft:custom_data" component.
  • Editing this NBT will directly update the item itself.

Full NBT of Item:

Pattern: full nbt of %item%

  • This has no change from previous behaviour.
  • This will return the full NBT of an item, generally used for serialization.
  • Will include the following tags "id", "count", "components", "Slot" (only on items within an inventory).
  • Editing this NBT will have no effect on the original item itself.
Clone this wiki locally