MCTOOLBOX
MC ToolboxMC TOOLBOX
Java command migration

Minecraft NBT to Components Converter

Convert legacy Java item NBT from 1.20.4 and older into item component syntax for 1.20.5, 1.21.x and the current 26.x releases. Commands stay in your browser.

Legacy input

Old item NBT or /give command

Load example:

Converted output

Current /give command

/give @p minecraft:diamond_sword[minecraft:custom_name={text:'Frost Blade',color:'aqua',italic:false},minecraft:lore=[{text:'Forged below Y -59',color:'gray'}],minecraft:damage=12,minecraft:repair_cost=3,minecraft:custom_model_data={floats:[27]},minecraft:unbreakable={},minecraft:enchantments={'minecraft:sharpness':5},minecraft:tooltip_display={hidden_components:['minecraft:unbreakable']}] 1

Components converted

8

Detected item

minecraft:diamond_sword

Components converted

  • display.Nameminecraft:custom_name
  • display.Loreminecraft:lore
  • Damageminecraft:damage
  • RepairCostminecraft:repair_cost
  • CustomModelDataminecraft:custom_model_data
  • Unbreakableminecraft:unbreakable
  • Enchantmentsminecraft:enchantments
  • HideFlagsminecraft:tooltip_display

Recognized fields

Names, lore, enchantments, damage, repair cost, unbreakable, CustomModelData, potion data, profiles, attributes and adventure-mode predicates are mapped to components.

Version-aware output

Minecraft 1.21.4 changed CustomModelData, while 1.21.5 simplified several components and introduced tooltip_display. Choose the server version you actually run.

Safe fallback

Unknown tags are preserved in minecraft:custom_data and listed for review. The converter does not pretend that custom_data makes obsolete game mechanics work.

Why Minecraft replaced item NBT with components

Minecraft Java 1.20.5 replaced the old mostly unstructured item tag with typed data components. In commands, components appear in square brackets after the item ID, separated by commas. Damage became minecraft:damage, display.Name became minecraft:custom_name, Enchantments became minecraft:enchantments, and arbitrary custom fields moved to minecraft:custom_data.

This was not a one-time syntax change. Minecraft 1.21.4 expanded custom_model_data into lists used by the new item model system. Minecraft 1.21.5 moved tooltip visibility into minecraft:tooltip_display and simplified enchantments, attributes, dyed colors and adventure-mode predicates. Current 26.x commands continue from that newer component format.

A converter can map known item fields, but it cannot automatically repair every command block or data pack. Entity NBT, block entity data, loot functions, predicates and text components also changed across versions. Always test the generated command in a copy of the target world or on a staging server.

How to convert an old /give command

  1. 1Paste a Java Edition /give command from 1.20.4 or older. You can also paste only the compound between braces.
  2. 2Choose the exact target family. Use 1.21.5 - 26.x for current servers, not the older 1.20.5 component shape.
  3. 3Read every warning. Preserved custom_data is safe storage, but it does not activate an obsolete Damage, Potion or AttributeModifiers tag.
  4. 4Copy the generated command and test it in a temporary world before replacing commands in a data pack or command-block system.

What this converter does not change

It converts one item stack or /give command at a time. It does not scan an entire data pack, rewrite execute if data checks, or update item predicates stored in JSON files.

It does not convert Bedrock item JSON. Java item components and Bedrock add-on components are different systems even when some names look similar.

Text components from very old versions may still need manual modernization. Complex player profiles, custom potion effects and block entity payloads should be checked against the target release.

NBT to components FAQ

Why did my old /give command stop working in 1.20.5?

Java 1.20.5 moved item data out of the old {tag} structure and into typed components written in square brackets after the item ID.

Can I put every old tag inside minecraft:custom_data?

You can preserve arbitrary fields there, but built-in mechanics no longer read old structural tags such as Damage or Enchantments from custom_data. They need their real components.

Which target should I use for Minecraft 26.2 or 26.3?

Use Minecraft 1.21.5 - 26.x. That output uses simplified enchantment and attribute shapes plus tooltip_display from the newer component system.

Does the converter support full commands?

Yes. It reads a legacy /give target, item ID, NBT compound and count, then rebuilds a current /give command. It also accepts a standalone NBT compound.

Why is there a warning for BlockEntityTag?

Current block_entity_data must identify a valid block entity. Some old commands relied on the item type and omitted the id, so that field needs manual review.

Is conversion performed on a server?

No. Parsing and conversion run locally in your browser. The command is not uploaded by this tool.