Updated:
The shape of a command
/give @p minecraft:diamond 5
Command name (give), target (@p), item ID (minecraft:diamond), amount (5). Each command has its own argument order, and swapping arguments causes an error.
Reading the notation in guides
| Notation | Meaning |
|---|---|
<target> | Required argument |
[amount] | Optional; a default is used if left out |
clear|rain|thunder | Pick one |
/weather <clear|rain|thunder> [duration] means /weather clear alone works. Do not type the brackets themselves.
Typing rules
- Plain characters only: full-width spaces or symbols from an input method look right but fail.
- One space between arguments: a double space can count as an empty argument.
- Lowercase English IDs:
Diamondfails.minecraft:can be left out. - The slash: needed in chat, optional in command blocks, and left out in data pack
.mcfunctionfiles.
Allow commands
In single player, turn on Allow Cheats when creating the world. Afterwards, Java can allow them temporarily through Open to LAN, and Bedrock through the world settings (which disables achievements). On a server you need operator status: run op PlayerName in the console. Without permission, Java may simply say the command is unknown.
Use the suggestions
Java shows suggestions as you type, and Tab completes them. If the text turns red, the game stopped understanding it from that point. Bedrock also shows syntax hints while typing.
Reading error messages
Unknown item 'minecraft:diamond_swrod'
...give @p minecraft:diamond_swrod<--[HERE]
Java marks the problem with <--[HERE]. Look at the word just before it; here it is a typo. More in unknown or incomplete command.
Build long commands with a tool
Named and enchanted items or summons with NBT are easy to break with a missing bracket. Build them in the give generator or similar, then edit only what you need.
Common questions
- Phones and Switch? Yes. Bedrock opens chat from the chat button (the speech bubble at the top on phones). Turn on cheats in the world settings.
- Achievements stopped unlocking. On Bedrock, a world that ever had cheats on can no longer earn achievements, even after turning them off. Use a copy of the world for testing.
- Repeat the last command? On Java, press the up arrow in chat.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.