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
- Use
/give @p minecraft:diamond_sword 1as the smallest working test. - Check whether the command is for Java Edition or Bedrock Edition.
- For Java 1.20.5+ examples, avoid mixing old NBT syntax and newer component-style syntax.
- Make sure every quote, bracket and comma is closed.
- Use a valid item ID such as
minecraft:diamond_sword.
Common error messages
| Error | Likely cause | Fix |
|---|---|---|
| Unknown or incomplete command | Missing bracket, wrong syntax, wrong version | Paste the command into the Error Doctor and simplify it step by step. |
| Expected whitespace | A comma, bracket or quote is in the wrong place | Check the character just before the red marker. |
| Unknown item | A 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 integer | A space between the item ID and [, so the game reads the components where the count should be | Write diamond_sword[...] with no space. |
| Unknown component | A misspelled component, or components used on a version before 1.20.5 | Check the name and your version. |
| No error, but no item | The inventory was full, so the item dropped at the player's feet, or the selector picked someone else | Look on the ground and check the target. |
One name, three formats
| Version | Command |
|---|---|
| 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
- Generate a basic /give command first.
- Test it in a backup world.
- Add custom name, lore and enchantments one by one.
- 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.