MC Toolkit

Guides / Commands & Data

The /give command after data components: what replaced NBT tags

1.20.5 replaced item NBT with data components, and most /give snippets online are still written the old way. Here is the mapping from the tags you know to the components that work now.

If you paste a /give command from an older guide and the game rejects it with a syntax error, the command is written against the pre-1.20.5 NBT format. Item data moved to data components, and the old {display:{Name:...}} blob no longer parses.

The shape changed

old   /give @p diamond_sword{display:{Name:'"Skybreaker"'},Enchantments:[{id:sharpness,lvl:5}]}
new   /give @p diamond_sword[custom_name="Skybreaker",enchantments={sharpness:5}]

Square brackets, not braces. Components are a flat, comma-separated list on the item id.

The mappings you will actually reach for

Old NBTData component
display:{Name:...}custom_name
display:{Lore:[...]}lore
Enchantments:[{id,lvl}]enchantments={id:level}
Unbreakable:1bunbreakable={}
CustomModelData:3custom_model_data={floats:[3]}
AttributeModifiers:[...]attribute_modifiers
display:{color:...}dyed_color
SkullOwnerprofile

Three traps

  • Quoting. custom_name takes a text component written as SNBT, so a plain name is just custom_name="Skybreaker". The old custom_name='"Skybreaker"' form from 1.20.5-era guides now names the item with the quote marks showing.
  • Removing a default. Prefix with ! to strip a component the item normally has — [!attribute_modifiers] gives a sword with no damage bonus at all.
  • Bedrock has none of this. Bedrock /give still uses its own data-value and component model; a Java component string will not run there.

The /give Generator writes the component form for you and shows the output for both editions, so you can copy the one that matches the server you are on.

/give Generator →

More guides

Browse all →