Updated:

When a /give command fails, the problem is usually not the item itself. It is often a version mismatch, a selector mistake, an old NBT example copied into a new Java version, or a Bedrock command used in Java Edition.

Quick checklist

Common error messages

ErrorLikely causeFix
Unknown or incomplete commandMissing bracket, wrong syntax, wrong versionPaste the command into the Error Doctor and simplify it step by step.
Expected whitespaceA comma, bracket or quote is in the wrong placeCheck the character just before the red marker.
Unknown itemA typo, or an item renamed in an update (grass became short_grass in Java 1.20.3)Look the ID up again with these methods.
Invalid integerA space between the item ID and [, so the game reads the components where the count should beWrite diamond_sword[...] with no space.
Unknown componentA misspelled component, or components used on a version before 1.20.5Check the name and your version.
No error, but no itemThe inventory was full, so the item dropped at the player's feet, or the selector picked someone elseLook on the ground and check the target.

One name, three formats

VersionCommand
Java 1.20.4 and earlier/give @p diamond_sword{display:{Name:'{"text":"Holy Sword"}'}} 1
Java 1.20.5–1.21.4/give @p diamond_sword[custom_name='{"text":"Holy Sword"}'] 1
Java 1.21.5 and later/give @p diamond_sword[custom_name={"text":"Holy Sword"}] 1

Even a simple name is written three ways depending on the version. Most failed copies come from mixing these up.

The count limit

Java's /give accepts up to 100 stacks of an item in one command: 6,400 for items that stack to 64, 1,600 for ender pearls and 100 for swords and other unstackable items. A higher number is an error. Anything that does not fit in the inventory drops on the ground.

Safe workflow

  1. Generate a basic /give command first.
  2. Test it in a backup world.
  3. Add custom name, lore and enchantments one by one.
  4. If it breaks, remove the last part and compare the syntax.

Bedrock /give

/give @p diamond_sword 1
/give @p diamond_pickaxe 1 0 {"minecraft:can_destroy":{"blocks":["stone"]}}

Bedrock takes the count, a data value and an optional JSON part, in that order. Java components such as [enchantments=...] do not work there, and Bedrock /give cannot add names or enchantments. Use an anvil or /enchant after giving the item.

Is the item ID red?

If the red marker sits on the ID or on the bracket after it, see why the item ID turns red for each cause.

Related tools