Minecraft Cheat Codes

22 cheat codes for Minecraft on PC.

Creative Mode (Unlock All)

Unlimited resources and flight.

/gamemode creative

Open chat (T), type /gamemode creative, Enter

Give Item (Unlock All)

Give yourself any item.

/give @p [item_id] [amount]

Open chat, type command with item and quantity

Teleport (Level Skip)

Teleport to any coordinates.

/tp @p [x] [y] [z]

Open chat, type /tp @p followed by x y z

Time Set Day (Misc)

Instantly sets time to daytime.

/time set day

Open chat, type /time set day

Clear Weather (Misc)

Clears rain and storms.

/weather clear

Open chat, type /weather clear

Kill All Mobs (Misc)

Kills all entities except players.

/kill @e[type=!player]

Open chat, type the command

Creative Mode (Misc)

Switch to creative mode

/gamemode creative

Give Item (Misc)

Spawn a diamond sword

/give @p diamond_sword 1

Set Time to Day (Misc)

Change time to morning

/time set day

Teleport (Misc)

Teleport to coordinates

/tp <player> <x> <y> <z>

Diamond Finding Tip (Tips)

Diamonds spawn most frequently at Y=-59 in modern Minecraft. Bring torches and a water bucket.

Mine at Y=-59

Villager Trading Exploit (Tips)

Cure a zombie villager (weakness potion + golden apple) for permanent 1-emerald trades. Best for books and gear.

Cure zombie villagers

Disable Mob Griefing (Misc)

Stop creepers/endermen from destroying your builds.

/gamerule mobGriefing false

Open chat, type /gamerule mobGriefing false

Keep Inventory on Death (Unlock All)

Never lose your items when you die.

/gamerule keepInventory true

Open chat (T), type /gamerule keepInventory true, Enter

Enchant Held Item (Weapons)

Instantly enchant the item you're holding to max level.

/enchant @s sharpness 5

Hold the item, open chat, type /enchant @s [enchantment] [level]

Set Difficulty (Misc)

Change world difficulty on the fly (peaceful/easy/normal/hard).

/difficulty peaceful

Open chat, type /difficulty followed by the difficulty name

Summon Any Entity (Misc)

Spawn any mob or entity at your location.

/summon zombie ~ ~ ~

Open chat, type /summon [entity_id] ~ ~ ~ to spawn at your position

Give Experience Levels (Unlock All)

Instantly max out your XP levels for enchanting.

/xp add @p 100 levels

Open chat, type /xp add @p [amount] levels

Apply Status Effect (God Mode)

Give yourself speed, strength, invisibility, or any other effect.

/effect give @p minecraft:speed 60 2

Open chat, type /effect give @p [effect] [duration_seconds] [amplifier]

Locate Nearest Structure (Misc)

Find the coordinates of the nearest village, stronghold, etc.

/locate structure minecraft:village

Open chat, type /locate structure minecraft:[structure_name]

Fill Area with Blocks (Unlock All)

Instantly fill a large area with any block — great for quick builds.

/fill ~ ~ ~ ~10 ~10 ~10 minecraft:diamond_block

Open chat, type /fill [x1 y1 z1] [x2 y2 z2] [block_id]

Summon Creeper (Misc)

Spawn a creeper

/summon creeper