Updated:

Where the red starts

Red partLikely cause
The item IDThe ID does not exist: a typo, a display name, an old ID or the other edition's ID
The { or [ after the IDItem data written for a different Java version
The selectorA wrong letter after @ or a bad argument inside [ ]

Cause 1: display names or capital letters

IDs are lowercase English with underscores. "Diamond Sword" is diamond_sword and "Golden Apple" is golden_apple. Spaces and capitals turn the ID red.

Cause 2: renamed or similar IDs

Updates sometimes rename items. In Java 1.20.3, grass became short_grass, so older tutorials now fail. Watch for near misses too: the enchanted apple is enchanted_golden_apple.

Cause 3: a Bedrock ID on Java (or the reverse)

A few items have different IDs per edition. The spawner is mob_spawner on Bedrock but spawner on Java.

Cause 4: old item data on Java 1.20.5+

Java 1.20.5 replaced item NBT with components. Old NBT turns red from the { after the ID.

Wrong: /give @p diamond_sword{Enchantments:[{id:"sharpness",lvl:5}]}
Right: /give @p diamond_sword[enchantments={sharpness:5}]

The second line is the 1.21.5+ form. On 1.20.5 to 1.21.4 write [enchantments={levels:{sharpness:5}}]. The give generator writes the right form for your version, and NBT vs components explains the change.

How to find the right ID

  1. In game (Java): press F3+H to turn on advanced tooltips, then hover over an item to see its ID.
  2. Autocomplete: type /give @p diamond and the game lists matching IDs. Press Tab to pick one.
  3. Search: the ID search finds IDs by name. More methods are in find item IDs.

Nothing is red, but no item arrives

If the inventory is full, the item drops at the player's feet. If the selector matches nobody, nothing happens. The give not working checklist covers the remaining causes.

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.