Updated:
New worlds
On the Create New World screen, set Allow Cheats to ON. That world then accepts commands any time.
Existing worlds
- Join the world and press Esc.
- Choose Open to LAN.
- Set Allow Cheats to ON and press Start LAN World.
This lasts until you close the world, so repeat it each time you play. The world is open to your local network meanwhile, which does not matter if nobody joins.
Open chat and type
| Key | What it does |
|---|---|
| T | Opens chat |
| / | Opens chat with the slash already typed |
| Tab | Completes commands and player names |
| Up / Down | Brings back earlier commands |
| Ctrl + V | Pastes a copied command |
While you type, the game suggests what comes next and turns mistakes red. Commands from our generators can be copied and pasted straight in.
The 256 character limit
Chat accepts at most 256 characters. A /give with many names and enchantments can go over. Use a command block instead, which holds much longer commands.
/give @s minecraft:command_block
Place it, right-click, paste the command and press Done. Set it to Always Active or add a button to run it (see the command block guide). Only operators in creative mode can edit command blocks.
On a server
- You need operator rights. Add the first operator from the server console with
op PlayerName(see op, kick and ban). - Command blocks also need
enable-command-block=truein server.properties.
Do cheats affect advancements?
On Java you still earn advancements with cheats on; unlike Bedrock, nothing gets locked. The world list does show the world as using cheats.
Common problems
- Unknown command: cheats are off or the spelling is wrong. If you used Open to LAN, check you have not reopened the world since.
- The command gets cut off: it is over 256 characters. Use a command block.
- A Bedrock command: commands found online may be Bedrock syntax (see Java vs Bedrock).
- Old syntax: some commands changed a lot in 1.20.5 and 1.21.5. Use examples for your version.
Common questions
- Keep cheats on permanently? In game, only worlds created with cheats allowed keep them; others need Open to LAN each session.
- Hardcore? Hardcore worlds cannot allow cheats at creation. Test commands in a separate normal world.
- Only me in multiplayer? On servers only operators can, though some commands such as /msg work for everyone.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.