NBT to Component Migrator - Convert Old Commands

Paste a pre-1.20.5 give command with old {NBT} and get the modern [component] version, with a mapping of every tag that changed.

Try an example

Works on give, item, and setblock commands. The conversion runs in your browser as you type. Nothing is uploaded.

Modern command (1.20.5+)
/give @p minecraft:diamond_sword[custom_name={"text":"Excalibur","color":"gold"},enchantments={"minecraft:sharpness":5,"minecraft:unbreaking":3},unbreakable={}]
What changed
display.Namebecomescustom_nameWrapped the name as a text component.
EnchantmentsbecomesenchantmentsList of {id,lvl} became a level map (2 entries).
UnbreakablebecomesunbreakableBoolean flag became the empty unbreakable component.

Minecraft NBT to component converter

This converter turns a pre-1.20.5 command with old item {NBT} into the modern [component] format the game uses from 1.20.5 onward. Paste a give, item, or setblock command, and it rewrites the item, then shows a tag-by-tag mapping so you can see exactly what changed. It runs entirely in your browser.

Minecraft 1.20.5 retired the old NBT tag system for items and replaced it with data components. A command that worked in 1.16 or 1.19 now throws a syntax error, because tags like {Enchantments:[...]} no longer exist. The item part has to be rewritten using square-bracket components such as [enchantments={...}].

Rewriting these by hand is slow and easy to get wrong. This tool reads the old compound, maps each tag to its component, fixes the format changes (operation numbers to names, name strings to text components, container slots), and reassembles the command for 26.3.

How to use the converter

1. Paste your old command into the box, or click one of the example chips to load a sample.

2. The modern command appears on the right and updates as you type. Hit Copy to grab it.

3. Check the mapping table to see which tags became components and which were kept under custom_data.

4. Paste the new command into the game (cheats on) or a command block in 26.3.

NBT tag to component mapping

The reference below lists how each common item tag maps to its 1.20.5+ component. Unknown tags fall back to custom_data so nothing is lost.

Old NBT tagNew componentFormat change
DamagedamageInteger durability damage, unchanged
display.Namecustom_nameWrapped as a text component
display.LoreloreList of text components
display.colordyed_colorPacked RGB integer for leather armor
EnchantmentsenchantmentsList of {id,lvl} becomes a level map
StoredEnchantmentsstored_enchantmentsSame level map, for books
AttributeModifiersattribute_modifiersOperation numbers become names
UnbreakableunbreakableEmpty component instead of a 1b flag
SkullOwnerprofileName and texture properties
CanDestroycan_breakBlock ids become block predicates
CanPlaceOncan_place_onBlock ids become block predicates
Potion / CustomPotionEffectspotion_contentsMerged into one component
TrimtrimPattern and material, namespaced
CustomModelDatacustom_model_dataInteger (later wrapped as floats)
BlockEntityTag.ItemscontainerSlot and count per stack
EntityTagentity_dataEntity NBT carried over
RepairCostrepair_costAnvil work penalty integer
(unknown tags)custom_dataPreserved verbatim, nothing dropped

The example: a named, enchanted, unbreakable sword

Take a classic old command for a custom sword:

/give @p diamond_sword{display:{Name:"..."},Enchantments:[{id:"minecraft:sharpness",lvl:5}],Unbreakable:1b}

The converter rewrites the name as a custom_name text component, turns the enchantment list into the enchantments level map, and swaps the Unbreakable:1b flag for the empty unbreakable={} component:

/give @p minecraft:diamond_sword[custom_name={"text":"Excalibur"},enchantments={"minecraft:sharpness":5},unbreakable={}]

Frequently Asked Questions

How do I convert an old NBT command to the new component format?

Paste your pre-1.20.5 command into the box. The tool reads the old {NBT} compound on the item, rewrites each tag as a 1.20.5+ component, and prints the new command. It also lists every tag that changed and anything it had to store under custom_data.

Why do my old give commands not work in 1.20.5?

Version 1.20.5 replaced item NBT tags with structured data components. The old curly-brace tags like {Enchantments:[...]} are gone, so a command written for 1.16 or 1.19 throws a syntax error. You have to rewrite the item part using square-bracket components, which is what this converter does.

What does Enchantments become in the component format?

The old list of {id,lvl} entries becomes a single map: enchantments={"minecraft:sharpness":5,"minecraft:unbreaking":3}. StoredEnchantments on an enchanted book becomes stored_enchantments with the same shape.

What happens to tags that have no matching component?

Any tag the converter does not recognise is preserved verbatim inside the custom_data component, so nothing is lost. The mapping table flags these in a separate Stored in custom_data list. HideFlags is the one exception: it no longer exists, so you set show_in_tooltip:false on each component instead.

Does this work for shulker boxes and other containers?

Yes. A BlockEntityTag holding Items is rewritten into the container component, with each stack mapped to its slot and count. Other block entity fields move to block_entity_data.

Does the converter send my command anywhere?

No. Everything runs in your browser as you type, with no network calls. The output uses 26.3 component syntax, the same format the latest Minecraft release expects.

Browse more Minecraft tools: