Minecraft cheats and commands: the most useful ones for Java and Bedrock

Verified on November 23, 2026Source: Gamepedix editorial team, cross-checked with several independent cheat lists
Minecraft doesn't have secret codes: its "cheats" are commands that you type in the chat. They work in Java Edition and Bedrock Edition (consoles, mobile and Windows), with small differences in syntax.
How to turn on cheats
- New world: turn on Allow Cheats (Java) or Activate Cheats (Bedrock) in the world settings.
- Existing world in Java: open it to LAN from the pause menu and enable Allow Cheats. This lasts until you leave the world.
- Bedrock: open the world settings and switch on cheats.
- Open the chat (
Tor/on PC, right on the D-pad on most controllers) and type the command.
Most useful commands
| Command | What it does |
|---|---|
/gamemode creative | Switch to Creative mode (survival, adventure and spectator also work) |
/time set day | Make it day (also night, noon, midnight) |
/weather clear | Stop the rain (also rain, thunder) |
/give @s diamond 64 | Give yourself 64 diamonds (any item ID works) |
/tp @s 0 100 0 | Teleport to coordinates X Y Z |
/locate structure village_plains | Find the nearest structure (Bedrock: /locate structure village) |
/locate biome cherry_grove | Find the nearest biome |
/gamerule keepInventory true | Keep your items when you die |
/effect give @s night_vision 9999 | Night vision (any effect works, with a duration in seconds) |
/xp add @s 30 levels | Add 30 experience levels (Bedrock: /xp 30L @s) |
/difficulty peaceful | Change the difficulty (easy, normal, hard) |
/seed | Show the world seed (Java) |
/kill @e[type=zombie] | Remove every zombie in loaded chunks |
/summon minecraft:horse | Spawn a mob where you stand |
@s means "yourself", @p the nearest player and @a every player.
Before you use cheats
- In Bedrock Edition, turning on cheats disables achievements for that world forever. Make a copy of the world first if you care about them.
- Java Edition advancements are not affected.
- On servers you need operator permissions to use commands.