Minecraft Commands: Cheat List for Java and Bedrock

Published by

Game mode and difficulty

CheatCommandEffect
Creative modeJava/gamemode creativeBedrock/gamemode creativeSwitch yourself to Creative mode
Survival for everyoneJava/gamemode survival @aBedrock/gamemode survival @aPut every player in Survival mode
Creative, short formJavaNot available on JavaBedrock/gamemode cBedrock shorthand for Creative mode; Java no longer takes abbreviations
Peaceful difficultyJava/difficulty peacefulBedrock/difficulty peacefulSet the world to Peaceful, so hostile mobs stop spawning
Hard difficultyJava/difficulty hardBedrock/difficulty hardSet the world to Hard difficulty

Inventory and game rules

CheatCommandEffect
Keep inventoryJava/gamerule keep_inventory trueBedrock/gamerule keepinventory trueKeep your inventory when you die
Give an itemJava/give @p pig_spawn_eggBedrock/give @p pig_spawn_eggGive the nearest player a pig spawn egg; swap in any item ID
Stop day and nightJava/gamerule advance_time falseBedrock/gamerule dodaylightcycle falseFreeze the day-night cycle at the current time
Stop weather changesJava/gamerule advance_weather falseBedrock/gamerule doweathercycle falseKeep the current weather from changing
No mob griefingJava/gamerule mob_griefing falseBedrock/gamerule mobgriefing falseStop mobs such as creepers from breaking blocks

Time and weather

CheatCommandEffect
Set time to noonJava/time set noonBedrock/time set noonPut the sun straight overhead
Set time to morningJava/time set 1000Bedrock/time set 1000Set the clock to 1000, early morning
Skip a full dayJava/time add 24000Bedrock/time add 24000Move time forward by one in-game day (24000 ticks)
Clear weatherJava/weather clear 24000Bedrock/weather clear 24000Stop rain and storms for 24000 ticks
Start rainJava/weather rainBedrock/weather rainMake it rain
ThunderstormJava/weather thunder 600Bedrock/weather thunder 600Start a thunderstorm for 600 ticks (30 seconds)

Player and effects

CheatCommandEffect
Add XP levelsJava/xp add Alice 3 levelsBedrock/xp 3L AliceGive the player Alice 3 levels; swap in your own name
Add XP pointsJava/experience add @s 7Bedrock/xp 7Give yourself 7 experience points
Near-invincibilityJava/effect give @s minecraft:resistance 1000000 4 trueBedrock/effect @s resistance 1000000 4 trueGive yourself Resistance V for 1,000,000 seconds with hidden particles
Speed boostJava/effect give @p minecraft:speed 60 1Bedrock/effect @p speed 60 1Give the nearest player Speed II for 60 seconds
Kill yourselfJava/kill @sBedrock/kill @sKill the player who runs the command
Clear dropped itemsJava/kill @e[type=item]Bedrock/kill @e[type=item]Remove every item lying on the ground

Teleport and world

CheatCommandEffect
Teleport to coordinatesJava/teleport 100 ~3 100Bedrock/teleport 100 ~3 100Teleport to x 100, 3 blocks up, z 100
Teleport to a playerJava/teleport AliceBedrock/teleport AliceTeleport yourself to the player Alice
Find a villageJava/locate structure #villageBedrock/locate structure villageShow the coordinates of the nearest village
Find a biomeJava/locate biome desertBedrock/locate biome desertShow the coordinates of the nearest desert
Summon lightningJava/summon lightning_bolt ~-10 ~ ~Bedrock/summon lightning_bolt ~-10 ~ ~Strike lightning 10 blocks from you along the x axis
Show world seedJava/seedBedrockNot available on BedrockShow the seed of the current world

Help and info

CheatCommandEffect
List commandsJava/helpBedrock/helpList 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

  1. Turn on Allow Commands when you create the world, or in World Options later.
  2. For a world made without it, open it to LAN and switch on Allow Cheats; this lasts until you quit.
  3. Press T or the slash key to open chat.
  4. Type the command, including the slash, and press Enter.

Bedrock

  1. Turn on Allow Cheats when you create the world, or in the Cheats tab of the world settings.
  2. Open chat.
  3. Type the command, including the slash, and press Enter.

Education

  1. Enable Activate Cheats in Game Settings.
  2. Open chat with T, Enter, or the slash key.
  3. 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.

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.

Part of

References: Minecraft Education: Essential Commands; Minecraft Wiki: Commands; Microsoft Learn: Popular commands in Minecraft Bedrock Edition; Minecraft Wiki: Game rule; Minecraft Wiki: /gamemode; Minecraft Wiki: /difficulty; Minecraft Wiki: /gamerule; Microsoft Learn: Bedrock /gamerule reference; Minecraft Wiki: /give; Minecraft Wiki: /time; Minecraft Wiki: /weather; Minecraft Wiki: /experience; Minecraft Wiki: /effect; Minecraft Wiki: /teleport; Minecraft Wiki: /locate; Minecraft Wiki: /summon; Minecraft Wiki: /kill; Minecraft Wiki: /seed.