Updated:
Where the red starts
| Red part | Likely cause |
|---|---|
| The item ID | The ID does not exist: a typo, a display name, an old ID or the other edition's ID |
The { or [ after the ID | Item data written for a different Java version |
| The selector | A 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
- In game (Java): press
F3+Hto turn on advanced tooltips, then hover over an item to see its ID. - Autocomplete: type
/give @p diamondand the game lists matching IDs. Press Tab to pick one. - 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
- Can I give blocks? Only blocks that exist as items. Water, lava, fire and nether portals do not, so give
water_bucketorlava_bucketinstead. - How do I pick a potion or arrow type? On Java 1.20.5+ use the
potion_contentscomponent. The potion generator handles each version. - Not red, but "Unknown item" when I run it? For modded items, include the mod's namespace, such as
modid:item.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.