Cheats & codes
Minecraft Cheat Codes
Grouped by type and platform, each one labelled reported working or tested.
There are 64 cheat codes for Minecraft across PC (Microsoft Windows). Each code below lists the exact button combination or console command, what it does, and whether using it disables achievements.
Cheat codes
7Add 30 experience levels
Adds 30 experience levels to you
Turn on Allow Commands when you create the world, open chat with T, type the command and press Enter
On Bedrock, turning on cheats disables achievements for that world permanently
Enchant held item with Sharpness V
Enchants the item in your hand with Sharpness V
Turn on Allow Commands when you create the world, hold the item, open chat with T, type the command and press Enter
On Bedrock, turning on cheats disables achievements for that world permanently
Keep items when you die
Keeps your inventory when you die instead of dropping it
Turn on Allow Commands when you create the world, open chat with T, type the command and press Enter
On Bedrock use /gamerule keepinventory true, and turning on cheats disables achievements for that world permanently
Speed effect for 300 seconds
Gives you Speed III for 300 seconds
Turn on Allow Commands when you create the world, open chat with T, type the command and press Enter
On Bedrock, turning on cheats disables achievements for that world permanently
Switch to Creative mode
Switches your game mode to Creative with unlimited resources and flying
Turn on Allow Commands when you create the world, open chat with T, type the command and press Enter
On Bedrock, turning on cheats disables achievements for that world permanently
Switch to Survival mode
Switches your game mode back to Survival
Turn on Allow Commands when you create the world, open chat with T, type the command and press Enter
On Bedrock, turning on cheats disables achievements for that world permanently
Teleport to coordinates
Teleports you to X 0, Y 100, Z 0
Turn on Allow Commands when you create the world, open chat with T, type the command and press Enter, changing the numbers to your target coordinates
On Bedrock, turning on cheats disables achievements for that world permanently
Console commands
56Add Experience
Adds experience points or full levels; /experience is the long-form alias in Java; Bedrock uses /xp with points only on some versions
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Add Experience Levels
Adds 100 experience levels
Enable cheats for the world, press T or / to open chat, type /experience add @s 100 levels and press Enter. Change 100 to any amount you want
On Bedrock, turning on cheats disables achievements for that world permanently, even if you turn cheats off later.
Advance Time
Advances world time by the given ticks
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Apply Status Effect
Applies a status effect (e.g., night_vision); Java uses /effect give, Bedrock legacy syntax order differs on some versions
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Back to survival
Returns you to normal play.
Press T and type the command.
Broadcast Chat Message
Broadcasts a plain chat message to all players (server use)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Clear All Effects
Removes all status effects from the player.
Press T, type /effect clear @s, press Enter.
Needs cheats enabled.
Clear Inventory
Clears inventory, or only the named item/amount
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Clear Status Effects
Removes status effects from the target
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Clear the weather
Stops rain and thunder.
Press T and type the command.
Clone Block Region
Copies a block region to a destination
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Creative Mode
Switches you to Creative mode with unlimited blocks and flight
Enable cheats for the world, press T or / to open chat, type /gamemode creative and press Enter
On Bedrock, turning on cheats disables achievements for that world permanently, even if you turn cheats off later.
Default Game Mode
Sets the mode new players start in for the world (Java mainly; also listed in Bedrock command lists)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Disable Fall Damage (Java)
Removes fall damage (true restores it); Bedrock uses gamerule falldamage on newer versions — check /gamerule list in-game
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Disable Mob Griefing
Stops creepers/ghast fireballs/endermen from destroying or moving blocks (rule name spelling can vary by edition/version)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Enchant Held Item
Enchants the item you are holding with Sharpness 5
Enable cheats for the world, press T or / to open chat, type /enchant @s sharpness 5 and press Enter. Change sharpness to any enchantment name and 5 to any level
On Bedrock, turning on cheats disables achievements for that world permanently, even if you turn cheats off later.
Fill Region with Block
Fills the box between two corners with a block; modes include replace, hollow, outline, keep, destroy; Java block volume limits apply
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Freeze Day/Night Cycle (Java)
Freezes the day/night cycle so time stops advancing; Bedrock equivalent is /alwaysday or /daylock true
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Game Mode: Creative
Puts the target player in Creative mode with flight (double-jump) and no damage
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Game Mode: Survival
Puts the target player in Survival mode (creative, adventure, and spectator are the other values)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Give Diamond Sword
Gives one diamond sword to the player.
Press T, type /give @s diamond_sword 1, press Enter.
Needs cheats enabled.
Give Item
Gives the target the named item (e.g., /give @s minecraft:diamond 10). Bedrock syntax uses itemName/data/components fields vs Java NBT
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Give Speed Effect
Gives Speed with amplifier 2 for 300 seconds.
Press T, type /effect give @s speed 300 2, press Enter.
Needs cheats enabled. Duration is in seconds.
Give yourself an item
Puts the named item in your inventory. Change diamond and 64 to any item and amount.
Press T and type the command.
Keep Inventory After Death
Keeps your inventory after death instead of dropping it (false restores default)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Keep Items on Death
You keep your items and XP when you die
Java Edition: type /gamerule keep_inventory true. Bedrock Edition: type /gamerule keepinventory true
Type the same command with false to turn it off again.
Keep your items when you die
You no longer drop your inventory on death.
Press T and type the command.
Kill Target
Kills the target player/entity; with no target in Java it kills the executor — be specific with @e[type=...]
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Locate Nearest Biome
Prints coordinates of the nearest matching biome (version-dependent)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Locate Nearest Structure
Prints coordinates of the nearest matching structure (e.g., village); Bedrock also supports /locate biome
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Locate Nearest Village
Shows coordinates of the nearest village structure.
Press T, type /locate structure village, press Enter.
Then teleport to the shown coordinates or travel there.
Lock Daylight (Bedrock)
Locks daylight so night never falls (sets doDaylightCycle off); /daylock true is the alias; Java equivalent is /gamerule doDaylightCycle false
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Night Vision
Gives you night vision with no end and no particles
Java Edition: type /effect give @s night_vision infinite 0 true. Bedrock Edition: type /effect @s night_vision infinite 0 true
On Bedrock, turning on cheats disables achievements for that world permanently, even if you turn cheats off later.
Peaceful Difficulty
Sets the world difficulty to peaceful, so no hostile mobs spawn
Enable cheats for the world, press T or / to open chat, type /difficulty peaceful and press Enter. Change peaceful to easy, normal or hard for other difficulties
On Bedrock, turning on cheats disables achievements for that world permanently, even if you turn cheats off later.
Remove every entity nearby
Kills everything except players.
Press T and type the command.
See in the dark
Grants night vision for the number of seconds given.
Press T and type the command.
This is the 1.13-and-later syntax. Older versions use /effect @s 16 9999 instead.
Set Difficulty To Hard
Sets world difficulty to Hard.
Press T, type /difficulty hard, press Enter.
Needs cheats enabled.
Set Difficulty: Peaceful
Sets world difficulty (peaceful, easy, normal, hard)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Set Player Spawn Point
Sets an individual player's respawn point
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Set Single Block
Replaces the single block at those coordinates
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Set the time to day
Skips straight to morning.
Press T and type the command.
Set Time of Day
Sets the world clock (0 = sunrise, 13000 = sunset; range 0-24000)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Set Time To Night
Sets the world time to night.
Press T, type /time set night, press Enter.
Needs cheats enabled.
Set Weather
Sets current weather, optionally for a duration; Bedrock also has /toggledownfall to toggle precipitation
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Set World Spawn
Sets the world spawn for all new/respawning players without a personal spawnpoint
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Show Command Help
Lists available commands or shows usage for one command
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Show World Seed
Shows the seed number of the current world in chat.
Press T, type /seed, press Enter.
Display only.
Start Rain
Starts rain in the world.
Press T, type /weather rain, press Enter.
Needs cheats enabled.
Stop Day Night Cycle
Stops the day and night cycle so time stays fixed.
Press T, type /gamerule doDaylightCycle false, press Enter.
Type /gamerule doDaylightCycle true to restart the cycle. Newer Java versions use lowercase do_daylight_cycle.
Stop hostile mobs spawning
No new mobs appear. Ones already in the world stay.
Press T and type the command.
Summon creeper
Spawns a creeper at the player location
Open chat with T in a world with cheats enabled, type the command, then press Enter
A summoned creeper can explode. Save before use
Summon Entity
Spawns the named mob/entity at your location or given coordinates (e.g., minecraft:enderman)
Type in chat — the world must have cheats enabled (Allow Cheats: On)
Enabling cheats disables achievements in Bedrock Edition worlds
Summon Zombie
Spawns a zombie at the player position.
Press T, type /summon zombie, press Enter.
Spawning hostile mobs in a safe base can cause damage. Use in a controlled area.
Switch To Spectator Mode
Switches the player to Spectator mode to fly through blocks and observe.
Press T, type /gamemode spectator @s, press Enter.
Needs cheats enabled.
Teleport
Teleports you to the coordinates 100, 64, -200
Enable cheats for the world, press T or / to open chat, type /tp @s 100 64 -200 and press Enter. Change the three numbers to any coordinates you want
On Bedrock, turning on cheats disables achievements for that world permanently, even if you turn cheats off later.
Teleport Up 10 Blocks
Teleports the player 10 blocks straight up from the current position.
Press T, type /tp @s ~ ~10 ~, press Enter.
Falling damage applies on landing in Survival mode.
Tips
1Turn cheats on
Every command below is refused unless the world has cheats enabled.
On the world-creation screen open More World Options and set Allow Cheats to ON. On a world made without cheats, open the pause menu and choose Open to LAN, then set Allow Cheats to ON. That lasts for the session only.
On Bedrock Edition, turning cheats on disables achievements for that world permanently. Java Edition advancements are not affected.
Tools for Minecraft cheats
-
Why is my Minecraft cheat not working?
Answer a few questions and get the specific reason, from our guides.
-
Search Minecraft codes by effect
Type "money" or "god mode" and find the code, typos forgiven.
-
Build a console command for Minecraft
Change the amount, item or location and copy a checked line.
-
Test your controller and button sequences
See every button respond, and check a sequence press by press.
Quick answers