Advertisement
Minecraft

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.

Verified
Sponsored

Cheat codes

7

Add 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

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

On Bedrock, turning on cheats disables achievements for that world permanently

Console commands

56

Add 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)

All platforms Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

Enabling cheats disables achievements in Bedrock Edition worlds

Back to survival

Returns you to normal play.

Press T and type the command.

PC Reported working ✓ 1 reader
Did this work for you? 1 of 1 reader says it worked

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)

All platforms Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

Enabling cheats disables achievements in Bedrock Edition worlds

Clear the weather

Stops rain and thunder.

Press T and type the command.

PC Reported working
Did this work for you?

Clone Block Region

Copies a block region to a destination

Type in chat — the world must have cheats enabled (Allow Cheats: On)

All platforms Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

See in the dark

Grants night vision for the number of seconds given.

Press T and type the command.

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

Enabling cheats disables achievements in Bedrock Edition worlds

Set the time to day

Skips straight to morning.

Press T and type the command.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

Display only.

Start Rain

Starts rain in the world.

Press T, type /weather rain, press Enter.

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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)

All platforms Reported working
Did this work for you?

Enabling cheats disables achievements in Bedrock Edition worlds

Summon Zombie

Spawns a zombie at the player position.

Press T, type /summon zombie, press Enter.

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

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

PC Reported working
Did this work for you?

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.

PC Reported working
Did this work for you?

Falling damage applies on landing in Survival mode.

Tips

1

Turn 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.

PC Reported working
Did this work for you?

On Bedrock Edition, turning cheats on disables achievements for that world permanently. Java Edition advancements are not affected.

A code stopped working after a patch? Tell us and we will retest it. Know one we are missing? Submit it here. What the tested badge means, and which codes carry it.

Tools for Minecraft cheats

Quick answers

About Minecraft cheats

How many cheats does Minecraft have?
This page lists 64 for Minecraft: 7 cheat codes, 56 console commands and 1 tip.
How do you enter cheats in Minecraft?
On PC: press T and type the command. On All: type in chat — the world must have cheats enabled (Allow Cheats: On). A few codes use a different method, shown beside each one.
Do cheats disable achievements in Minecraft?
42 of the 64 codes here carry a warning about achievements or trophies. The note reads: "On Bedrock, turning on cheats disables achievements for that world permanently."
Which platforms are these Minecraft cheats for?
The codes on this page are listed for PC (36 codes). Where the game came out on other systems, the codes may differ there.
Are these Minecraft cheats still working?
All 64 are marked "Reported working": each comes from a documented source, and none has been run by us yet. A code we test gets a dated "Tested" badge.
Advertisement