How to Use /give with Custom NBT Tags, Enchantments, Lore & Attributes (1.20 to 1.21+)
How to build custom items with /give in 1.20.5 and 1.21+: unbreakable weapons, custom names, multi-line lore with RGB colors, over-the-cap enchantments and attribute modifiers.
In this guide
1. The 1.20.5 / 1.21 Item Components Overhaul
Since 1.20.5, item NBT has been replaced by item components. This command creates an unbreakable netherite sword with Sharpness 10, a custom RGB name and multi-line lore:
# Modern 1.20.5 / 1.21+ Component Give Command:
/give @p netherite_sword[
custom_name='{"text":"Voidrender Greatsword","color":"#b2ff00","bold":true}',
lore=['{"text":"Forged in the depths of the End","color":"#aaaaaa","italic":true}','{"text":"Level 100 Boss Weapon","color":"#ff5555"}'],
enchantments={levels:{"minecraft:sharpness":10,"minecraft:looting":5,"minecraft:fire_aspect":3}},
unbreakable={},
attribute_modifiers=[{type:"minecraft:generic.attack_damage",amount:25.0,operation:"add_value",slot:"mainhand",id:"enzonic:god_weapon"}]
] 1