Presets

Item presets

Minecraft 1.20.5+ Item Components Give Command

Java 1.20.5 changed the center of item command syntax. This article targets the exact migration search intent: how to express a give command with item components instead of copying old NBT examples.

Preset result

A modern component-style /give command that can be compared against older Java item NBT before migration.

Output

Java 1.20.5+ component output

/give @p minecraft:diamond_sword[custom_name={text:"Component Blade",color:"gold",italic:false},lore=[{text:"Built with Java 1.20.5+ item components",color:"gray",italic:false}],enchantments={"minecraft:sharpness":5},unbreakable={},custom_data={component_demo:1}] 1
Too long for Minecraft chat

The longest command line is 265 characters, 9 over the 256-character chat input limit. Pasting it into chat can truncate the line and make Minecraft report a syntax error even when the generated command is valid.

  • Use a Command Block: run /give @s command_block, place it, then paste this command into the block command field.
  • Use a .mcfunction for a reusable datapack: save the line without the leading slash at saves/<world>/datapacks/<pack>/data/<ns>/function/<name>.mcfunction with a minimal pack.mcmeta, run /reload, then run /function <ns>:<name>. Do not paste .mcfunction content into chat.

Preset screenshot

The NBTForge workbench state used for the minecraft 1.20.5 item components give command article, including the visible controls and generated output.

Build the preset

  1. Set the version selector to Java 1.20.5 or later before editing the item.
  2. Add custom_name, lore, enchantments, unbreakable, and custom_data from the Give workbench.
  3. Compare the output against the Java 1.20.4 guide if you are migrating an old map.
  4. Copy the component output only after the target server version is confirmed.

What changed after 1.20.4

Many item details that older commands stored in NBT are now written as item components. That includes common fields such as custom_name, lore, enchantments, unbreakable, and custom_data.

NBTForge keeps the version selector visible because this is a syntax choice, not a cosmetic formatting choice.

  • Use 1.20.4 or older for legacy NBT output.
  • Use 1.20.5+ for component output.
  • Use the Java item components guide when migrating a whole command pack.

Migration workflow

Start with the old item intent rather than the old command string. Recreate the item in the Give workbench, set the modern version, then compare the generated output.

If the item appears in loot tables, shops, or summon equipment, save the rebuilt component item to Project so the other commands use the same source.

Fit the preset into a real project

Treat Minecraft 1.20.5+ Item Components Give Command as a tested starting point, not just a copied string. After the output works once, save it with a clear Project name, note the target Minecraft version, and keep the preset near related setup commands such as scoreboard, bossbar, loot, or reset lines.

Before publishing the preset to a map, server, or command pack, run it from the copied artifact rather than only from the live workbench. That catches missing dependencies, stale selectors, wrong edition choices, and commands that only worked because local test state already existed.

  • Keep the selected Edition and Version with the shared command.
  • Test selectors against a harmless command before using damage, kill, clear, or teleport.
  • Move long commands into Project or a function-style workflow instead of pasting them into chat.
  • Recheck warnings after changing entities, item components, passengers, or datapack resources.

FAQ

Can I paste an old NBT give command into a 1.20.5+ world?

Some old examples fail or behave differently. Rebuild the item as components when the target world is Java 1.20.5 or later.

Is custom_data the same as old custom NBT?

It is the modern component used for stable custom item data in current Java item output.

When should this preset become part of a command pack?

Use it as a command pack entry when the output depends on setup lines, reset commands, loot resources, scoreboard state, or repeated testing. Single safe commands can still be copied directly from Output.

Open this workflow

Start from the related Give workbench, then adjust the preset fields for your world.