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 answers Unknown item tag or silently drops your enchantments, 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 NBT | Data component |
|---|---|
display:{Name:...} | custom_name |
display:{Lore:[...]} | lore |
Enchantments:[{id,lvl}] | enchantments={id:level} |
Unbreakable:1b | unbreakable={} |
CustomModelData:3 | custom_model_data=3 |
AttributeModifiers:[...] | attribute_modifiers |
display:{color:...} | dyed_color |
SkullOwner | profile |
Three traps
- Quoting.
custom_nametakes a JSON text component, so a plain string still needs
its own quotes inside the argument: custom_name='"Skybreaker"'.
- 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
/givestill 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.