Minecraft Commands: Cheat List for Java and Bedrock
- Java Turn on Allow Commands for the world, press T or /, type the command and press Enter.
- Bedrock Turn on Allow Cheats in the world settings, open chat, type the command and press Enter.
Published by Andrew B.
No cheats match that filter.
Game mode and difficulty
| Cheat | Command | Effect |
|---|---|---|
| Creative mode | Java/gamemode creativeBedrock/gamemode creative | Switch yourself to Creative mode |
| Survival for everyone | Java/gamemode survival @aBedrock/gamemode survival @a | Put every player in Survival mode |
| Creative, short form | JavaNot available on JavaBedrock/gamemode c | Bedrock shorthand for Creative mode; Java no longer takes abbreviations |
| Peaceful difficulty | Java/difficulty peacefulBedrock/difficulty peaceful | Set the world to Peaceful, so hostile mobs stop spawning |
| Hard difficulty | Java/difficulty hardBedrock/difficulty hard | Set the world to Hard difficulty |
Inventory and game rules
| Cheat | Command | Effect |
|---|---|---|
| Keep inventory | Java/gamerule keep_inventory trueBedrock/gamerule keepinventory true | Keep your inventory when you die |
| Give an item | Java/give @p pig_spawn_eggBedrock/give @p pig_spawn_egg | Give the nearest player a pig spawn egg; swap in any item ID |
| Stop day and night | Java/gamerule advance_time falseBedrock/gamerule dodaylightcycle false | Freeze the day-night cycle at the current time |
| Stop weather changes | Java/gamerule advance_weather falseBedrock/gamerule doweathercycle false | Keep the current weather from changing |
| No mob griefing | Java/gamerule mob_griefing falseBedrock/gamerule mobgriefing false | Stop mobs such as creepers from breaking blocks |
Time and weather
| Cheat | Command | Effect |
|---|---|---|
| Set time to noon | Java/time set noonBedrock/time set noon | Put the sun straight overhead |
| Set time to morning | Java/time set 1000Bedrock/time set 1000 | Set the clock to 1000, early morning |
| Skip a full day | Java/time add 24000Bedrock/time add 24000 | Move time forward by one in-game day (24000 ticks) |
| Clear weather | Java/weather clear 24000Bedrock/weather clear 24000 | Stop rain and storms for 24000 ticks |
| Start rain | Java/weather rainBedrock/weather rain | Make it rain |
| Thunderstorm | Java/weather thunder 600Bedrock/weather thunder 600 | Start a thunderstorm for 600 ticks (30 seconds) |
Player and effects
| Cheat | Command | Effect |
|---|---|---|
| Add XP levels | Java/xp add Alice 3 levelsBedrock/xp 3L Alice | Give the player Alice 3 levels; swap in your own name |
| Add XP points | Java/experience add @s 7Bedrock/xp 7 | Give yourself 7 experience points |
| Near-invincibility | Java/effect give @s minecraft:resistance 1000000 4 trueBedrock/effect @s resistance 1000000 4 true | Give yourself Resistance V for 1,000,000 seconds with hidden particles |
| Speed boost | Java/effect give @p minecraft:speed 60 1Bedrock/effect @p speed 60 1 | Give the nearest player Speed II for 60 seconds |
| Kill yourself | Java/kill @sBedrock/kill @s | Kill the player who runs the command |
| Clear dropped items | Java/kill @e[type=item]Bedrock/kill @e[type=item] | Remove every item lying on the ground |
Teleport and world
| Cheat | Command | Effect |
|---|---|---|
| Teleport to coordinates | Java/teleport 100 ~3 100Bedrock/teleport 100 ~3 100 | Teleport to x 100, 3 blocks up, z 100 |
| Teleport to a player | Java/teleport AliceBedrock/teleport Alice | Teleport yourself to the player Alice |
| Find a village | Java/locate structure #villageBedrock/locate structure village | Show the coordinates of the nearest village |
| Find a biome | Java/locate biome desertBedrock/locate biome desert | Show the coordinates of the nearest desert |
| Summon lightning | Java/summon lightning_bolt ~-10 ~ ~Bedrock/summon lightning_bolt ~-10 ~ ~ | Strike lightning 10 blocks from you along the x axis |
| Show world seed | Java/seedBedrockNot available on Bedrock | Show the seed of the current world |
Help and info
| Cheat | Command | Effect |
|---|---|---|
| List commands | Java/helpBedrock/help | List the commands you can run |
A code here did not work? Tell us and it gets rechecked. Report a code
How to enter cheats in Minecraft
Java
- Turn on Allow Commands when you create the world, or in World Options later.
- For a world made without it, open it to LAN and switch on Allow Cheats; this lasts until you quit.
- Press T or the slash key to open chat.
- Type the command, including the slash, and press Enter.
Bedrock
- Turn on Allow Cheats when you create the world, or in the Cheats tab of the world settings.
- Open chat.
- Type the command, including the slash, and press Enter.
Education
- Enable Activate Cheats in Game Settings.
- Open chat with T, Enter, or the slash key.
- Type the command and submit it.
Do cheats disable achievements in Minecraft?
On Bedrock, yes, and for good. The Minecraft Wiki says turning on cheats in a Bedrock world permanently stops achievements there, even if you later switch cheats off. In Java Edition the wiki describes cheats as only a permission setting, with no achievement lock mentioned. Minecraft Wiki: Commands
Can you use these cheats in multiplayer?
On a server, most commands need operator status rather than a cheats switch, according to the Minecraft Wiki. In a LAN world the host decides: Allow Cheats on the LAN screen gives the other players commands until the host quits. Minecraft Wiki: Commands
Compatibility notes
Which releases these codes apply to, and where one behaves differently. Each note links to the source that documents it.
- Java Edition 1.21.11 The Minecraft Wiki says this release (snapshot 25w44a) renamed all game rules to snake_case. doDaylightCycle became advance_time and doWeatherCycle became advance_weather, so older guides that use the old names fail on current Java. Minecraft Wiki: Game rule
- Java vs Bedrock shorthand Per the Minecraft Wiki, Java dropped short and numeric forms in 17w45a, so it only takes full names like creative or hard. Bedrock still accepts c or 1 for Creative and h or 3 for Hard. Minecraft Wiki: /gamemode
- Bedrock Edition The Minecraft Wiki says turning on cheats in a Bedrock world permanently stops achievements in that world, even if you turn cheats off again. Minecraft Wiki: Commands
- Java worlds without cheats The Minecraft Wiki says you can still get commands in a Java world made without them: open it to LAN and switch on Allow Cheats. This only lasts until the host quits the world. Minecraft Wiki: Commands
FAQ
How do you turn on cheats in Minecraft?
In Java, turn on Allow Commands for the world, or open it to LAN and switch on Allow Cheats. In Bedrock, turn on Allow Cheats in the world settings. In Minecraft Education, turn on Activate Cheats in Game Settings.
Do Minecraft cheats disable achievements?
On Bedrock, yes: turning on cheats in a world permanently blocks achievements in that world, even if you turn cheats off again.
What is the keep inventory command in Minecraft?
On current Java it is /gamerule keep_inventory true. On Bedrock it is /gamerule keepinventory true.
Why does a Minecraft command from an old guide not work?
Java and Bedrock use different syntax for many commands, and Java 1.21.11 renamed every game rule to snake_case. Check the column for your edition, or run /help in your game.
What does the @s selector mean in Minecraft commands?
@s means yourself; @a means every player. Start with @s when learning so you only change your own game.
