1. A gold-named sword from legacy NBT
Keep the sword name, color and enchantment when changing the item data format
/give @p minecraft:diamond_sword[minecraft:custom_name={text:'ดาบผู้พิทักษ์',color:'gold',italic:0b},minecraft:enchantments={'minecraft:sharpness':5},minecraft:unbreakable={}] 1
What it does Convert NBT → Components + SNBT: minecraft:diamond_sword × 1, preserving name and text styling, enchantments, unbreakable
- Item IDs, enchantment IDs and targets are preserved. Check that they exist in the destination version