mojira.dev
MC-299975

NBT commands broken in Minecraft Java 1.21.8: /give fails with "space required" error

In Minecraft Java Edition 1.21.8, any /give command using NBT breaks with the following error:

"A space is required to end the argument. Some data is written without separation."

Example of broken command:
/give @p minecraft:iron_pickaxe{Enchantments:[{id:"minecraft:unbreaking",lvl:1s}]} 1

Same command works perfectly in 1.20.4 and earlier.

  • Using official launcher

  • No mods, datapacks, or plugins

  • Singleplayer world with cheats

  • Tested on Windows 10

Expected behavior: The item should be given with proper enchantments.
Actual behavior: Command fails with a syntax parser error.

Please fix — this breaks most NBT-based commands.

Comments 1

flow_santohyj123

This is not a bug. Item NBT has been changed to Item Components in 1.20.5, check the changelogs and the wiki for more information.
The correct command would be:

/give @p minecraft:iron_pickaxe[minecraft:enchantments={"minecraft:unbreaking":1}] 1

Lisandro Bernal

(Unassigned)

Unconfirmed

(Unassigned)

1.21.8

Retrieved