Discord
Minecraft cheats

Minecraft cheats and commands: codes to copy and paste

Cheats in Minecraft are commands that you type in chat to change your game mode, teleport, give yourself items, control the weather and much more. This page is a cheat sheet with codes ready to copy and paste straight into the game. You can copy any command with one click.

The commands work in both Java Edition and Bedrock Edition (Windows, Xbox, PlayStation, Switch, phones), although some differ in syntax. Below we point out when a command behaves differently between editions. The cheat sheet matches version 26.3 (Wilderness Bound), in which Java got the /compute command for calculations in data packs. If you want a plain reference table instead of ready-made snippets, or the /compute syntax, see the complete command list or the command guides.

Last updated: October 7, 2026 (current for Minecraft 26.3, Java and Bedrock Edition)

How to enable cheats in Minecraft

You need cheats turned on before you can use any command. There are three ways, depending on your situation:

When creating a new world

The easiest way. When you create a new world:

Note: In Bedrock Edition, turning on cheats permanently disables achievements in that world. You cannot undo it without external tools.

In an existing world: Open to LAN (Java Edition only)

If you already have a world without cheats, you can turn them on temporarily:

  1. Press Esc → click Open to LAN
  2. Switch Allow Cheats to ON
  3. Click Start LAN World

Cheats stay active until you quit the game. The next time you launch the world you have to repeat the procedure. It is a great trick for using cheats temporarily without a permanent change.

On a multiplayer server

On a server you need operator (OP) status. The server administrator can grant it by typing this in the server console:

op PlayerName (click to copy)

On servers with plugins (Paper, Spigot), permissions for individual commands are managed through plugins such as LuckPerms. That lets you give a player access to, say, just /gamemode without full OP.

How to enter commands

Press T (chat) or / (opens chat with the slash already typed). Type the command and press Enter. Every command starts with a / character. The game suggests the syntax when you press Tab, so use it!

Game modes: /gamemode

The /gamemode command changes your game mode. Minecraft has four modes, each with different rules:

Command Description Copy
/gamemode survival Survival mode, the default. You gather resources, craft, fight mobs, and you can die.
/gamemode creative Creative mode: unlimited resources, flying, invulnerability. Ideal for building.
/gamemode adventure Adventure mode: you cannot break or place blocks (unless you have the right tool). Used on adventure maps.
/gamemode spectator Spectator mode: you fly through blocks and are invisible. Java Edition only.

Shortcuts: In Java Edition you can use numbers instead of names: /gamemode 0 (survival), /gamemode 1 (creative), /gamemode 2 (adventure), /gamemode 3 (spectator). In newer versions, though, using the full names is recommended.

Changing another player's game mode

/gamemode creative Steve (click to copy) - changes Steve's game mode to creative.

Default game mode

The /defaultgamemode command sets the game mode for new players joining the world:

/defaultgamemode creative (click to copy)

Teleporting: /tp and /teleport

The /tp command (short for /teleport) moves a player anywhere. It is one of the most commonly used cheats:

Command Description Copy
/tp 100 64 200 Teleports you to coordinates X=100, Y=64, Z=200
/tp Steve Teleports you to the player Steve
/tp Steve Alex Teleports the player Steve to the player Alex
/tp Steve 100 64 200 Teleports the player Steve to coordinates 100 64 200
/tp @a 0 100 0 Teleports all players to the point 0 100 0
/tp ~ ~10 ~ Teleports you 10 blocks up (the tilde ~ means a relative coordinate)
/tp @s ~ ~ ~ facing 0 0 0 Turns you to face the point 0 0 0 (Java only)

Tip: Press F3 (Java) to see your current coordinates. Write them down before you teleport far away, so you can easily get back. The Y coordinate is height: Y=64 is roughly sea level, and Y=-64 is the deepest point of the world (since 1.18).

Giving items: /give

The /give command adds items to your inventory. Syntax: /give [player] [item] [amount]

Most popular items

Command What you get Copy
/give @s diamond 64 64 diamonds
/give @s netherite_sword Netherite sword
/give @s netherite_pickaxe Netherite pickaxe
/give @s diamond_block 64 64 blocks of diamond
/give @s golden_apple 64 64 golden apples
/give @s enchanted_golden_apple 64 64 enchanted golden apples (Notch apple)
/give @s elytra Elytra (wings)
/give @s trident Trident
/give @s totem_of_undying Totem of Undying
/give @s ender_pearl 16 16 ender pearls
/give @s firework_rocket 64 64 firework rockets (for flying with an elytra)
/give @s command_block Command block (not normally available)
/give @s tnt 64 64 TNT
/give @s experience_bottle 64 64 bottles o' enchanting

Tip: Use @s instead of typing your own name: @s always means "me" (the command's executor). To give an item to another player, type their name instead of @s. Our /give command generator will help you build commands with enchantments and NBT data.

Time and weather

Control the time of day and the weather with the /time and /weather commands. Handy when you want to avoid night-time mob attacks or take nice screenshots.

Time of day: /time

Command Description Copy
/time set day Sets day (1,000 ticks, about 7:00 AM)
/time set noon Sets noon (6,000 ticks, 12:00)
/time set night Sets night (13,000 ticks, about 7:00 PM)
/time set midnight Sets midnight (18,000 ticks, 00:00)
/time set sunrise Sets sunrise (23,000 ticks). Java 1.21+ only
/time set sunset Sets sunset (12,000 ticks). Java 1.21+ only
/time set 0 Sets a specific tick (0 = dawn, 6,000 = noon, 12,000 = dusk, 18,000 = midnight)
/time add 1000 Moves time forward by 1,000 ticks (about 50 seconds)
/time query daytime Shows the current time in ticks

Fun fact: A full day/night cycle in Minecraft lasts 24,000 ticks, which is exactly 20 minutes of real time. One tick = 1/20 of a second.

Weather: /weather

Command Description Copy
/weather clear Clear sky (no rain or thunderstorm)
/weather rain Turns on rain (snow in cold biomes)
/weather thunder Turns on a thunderstorm with lightning (needed to turn a creeper into a charged creeper)
/weather clear 1000000 Clear sky for 1,000,000 seconds (over 11 days, practically forever)

Pro tip: To turn the weather cycle off permanently, use /gamerule doWeatherCycle false after setting the weather (in Java since version 1.21.11: /gamerule advance_weather false). You will find more about game rules below.

Effects: /effect

The /effect command applies potion effects to a player or a mob. Syntax: /effect give [target] [effect] [seconds] [amplifier] [hideParticles]

Useful effects to apply

Command Effect Copy
/effect give @s speed 9999 2 Speed III for about 2.7 hours
/effect give @s strength 9999 1 Strength II: doubles attack damage
/effect give @s resistance 9999 3 Resistance IV: reduces damage by 80%
/effect give @s regeneration 9999 4 Regeneration V: near-instant healing
/effect give @s fire_resistance 9999 Fire Resistance: protects you from fire and lava
/effect give @s water_breathing 9999 Water Breathing: unlimited diving
/effect give @s night_vision 9999 Night Vision: everything is as bright as in daytime
/effect give @s invisibility 9999 Invisibility: mobs cannot see you (if you are not wearing armor)
/effect give @s jump_boost 9999 4 Jump Boost V: you jump much higher
/effect give @s haste 9999 2 Haste III: you mine blocks much faster
/effect give @s saturation 9999 10 Saturation: you will never get hungry
/effect give @s slow_falling 9999 Slow Falling: you take no fall damage
/effect give @s conduit_power 9999 Conduit Power: underwater breathing, better vision and faster mining underwater
/effect give @s dolphins_grace 9999 Dolphin's Grace: fast swimming (Java only)
/effect give @s hero_of_the_village 9999 Hero of the Village: big discounts from villagers
/effect give @s glowing 9999 Glowing: your outline is visible through blocks (Java only)

Removing effects

Command Description Copy
/effect clear @s Removes all effects from yourself
/effect clear @s night_vision Removes a specific effect (for example Night Vision)
/effect clear @a Removes all effects from all players

Note: The effect amplifier in the command starts at 0 (level I). So 0 = level I, 1 = level II, and so on. The maximum duration is 1,000,000 seconds. For an infinite effect (since Java 1.20.2), use the word infinite instead of a number of seconds: /effect give @s night_vision infinite.

Game rules: changing how the world works

The /gamerule command changes the rules the world runs by. These are some of the most powerful cheats, because they affect fundamental game mechanics. Changes are permanent and stay in effect until you undo them by hand.

Note for Java Edition: since version 1.21.11, game rules in Java use snake_case names, and some of them received entirely new names. Instead of keepInventory you type keep_inventory, instead of doDaylightCycle you type advance_time, and instead of doMobSpawning you type spawn_mobs. The table below and the ready-made commands further down the page use the old spelling, so in Java Edition 26.3 check the rule name in the chat suggestions after you type /gamerule.

The most important game rules

Command What it does Copy
/gamerule keepInventory true You keep your inventory after death (you lose neither items nor XP). Easily the most wanted cheat.
/gamerule doDaylightCycle false Stops the day/night cycle. The time of day never changes. Ideal for building.
/gamerule doWeatherCycle false Stops the weather from changing. Set the weather first with /weather clear.
/gamerule doMobSpawning false Turns off spawning of all mobs (hostile and passive). The world will be empty.
/gamerule mobGriefing false Mobs do not destroy blocks. Creepers leave no craters, endermen do not pick up blocks, ghasts do not set fires.
/gamerule doFireTick false Fire does not spread. Protects wooden builds from burning down.
/gamerule doInsomnia false Turns off phantoms: they do not appear when you go without sleep. Java Edition only.
/gamerule randomTickSpeed 100 Speeds up plant growth 33x (the default is 3). Set it to 0 to freeze plants.
/gamerule showDeathMessages false Hides death messages in chat.
/gamerule naturalRegeneration false Turns off natural healing from a full hunger bar. Ultra Hardcore (UHC) style.
/gamerule doTileDrops false Blocks do not drop items when destroyed. Handy for clearing terrain without littering the ground.
/gamerule announceAdvancements false Turns off advancement announcements in chat. Java Edition only.
/gamerule commandBlockOutput false Turns off command block messages in chat. Essential on adventure maps.
/gamerule sendCommandFeedback false Hides command responses in chat. Keeps chat clean.
/gamerule playersSleepingPercentage 0 One player can sleep through the night for everyone (the default is 100, meaning everyone has to sleep). Java only.
/gamerule spawnRadius 0 Players respawn exactly at the spawn point (the default is 10: a random spot within 10 blocks).
/gamerule doImmediateRespawn true Skips the death screen for an instant respawn. Useful on PvP servers.
/gamerule fallDamage false Turns off fall damage. Bedrock Edition only.
/gamerule tntExplodes false TNT does not explode. Bedrock Edition only.

To restore the default value, type the same command with the opposite value. For example, to turn mob spawning back on: /gamerule doMobSpawning true. The default value of randomTickSpeed is 3.

Spawn, respawn, and killing

Control spawn points and remove entities instantly:

Command Description Copy
/setworldspawn Sets the world spawn at your current position. New players appear here.
/setworldspawn 100 64 200 Sets the world spawn at specific coordinates.
/spawnpoint @s Sets your personal respawn point at your current position (like a bed).
/spawnpoint @s 100 64 200 Sets your respawn point at specific coordinates.
/kill Kills you instantly. A quick way back to spawn.
/kill @e[type=!player] Kills every entity except players (mobs, items on the ground, and so on).
/kill @e[type=zombie] Kills all zombies in the world.
/kill @e[type=item] Removes all dropped items from the ground (helps with lag).

Note: The /kill command without parameters kills whoever runs it. Always use a selector when you want to kill specific entities.

World: locating, filling, cloning

Seed and locating structures

Command Description Copy
/seed Shows the world seed. You can use it to recreate the same world.
/locate structure minecraft:village_plains Finds the nearest plains village.
/locate structure minecraft:fortress Finds the nearest Nether fortress (with blazes and wither skeletons).
/locate structure minecraft:stronghold Finds a stronghold with an End portal.
/locate structure minecraft:mansion Finds the nearest woodland mansion.
/locate structure minecraft:monument Finds an ocean monument.
/locate structure minecraft:ancient_city Finds an ancient city in the deep dark.
/locate structure minecraft:trial_chambers Finds trial chambers (added in 1.21).
/locate biome minecraft:cherry_grove Finds the nearest cherry grove biome.
/locate biome minecraft:mushroom_fields Finds the nearest mushroom fields biome.

Tip: Once a structure is found, the game shows its coordinates. Click them in chat to type out a /tp command with those coordinates automatically (Java Edition only). You will find a list of the most interesting seeds in our seed catalog.

Building: /fill, /clone, /setblock

These commands let you modify blocks in the world in bulk. They are essential for large building projects.

Command Description Copy
/setblock ~ ~ ~ diamond_block Places a block of diamond at your position.
/setblock ~ ~-1 ~ bedrock Places a bedrock block under your feet.
/fill ~-5 ~ ~-5 ~5 ~3 ~5 stone Fills an 11x4x11 area around you with stone. Great for putting up walls fast.
/fill ~-5 ~ ~-5 ~5 ~3 ~5 air Fills the area with air: a quick way to destroy blocks across a large area.
/fill ~-10 ~-10 ~-10 ~10 ~10 ~10 air replace water Removes water within a 10-block radius (replaces water with air).
/fill ~-5 ~-1 ~-5 ~5 ~-1 ~5 glass Creates an 11x11 glass floor under your feet.
/fill ~-5 ~ ~-5 ~5 ~3 ~5 stone hollow Creates a stone shell (hollow inside): an instant house.
/clone ~-5 ~ ~-5 ~5 ~5 ~5 ~10 ~ ~ Clones an 11x6x11 build and pastes it 10 blocks further along the X axis.

You will find more about the /fill command in its own guide. The limit for /fill is 32,768 blocks (a cube of about 32x32x32). To fill a larger area, run the command several times.

Server commands: managing players

The commands below are meant for server administrators and anyone running a multiplayer game:

Command Description Copy
/op Steve Gives the player Steve operator status (full access to commands).
/deop Steve Takes operator status away from the player.
/kick Steve Reason for kick Kicks a player from the server with the given reason.
/ban Steve Griefing Bans a player permanently with the given reason.
/pardon Steve Unbans a player (lifts the ban).
/ban-ip 192.168.1.1 Bans an IP address (the player cannot join even on another account).
/whitelist on Turns the whitelist on: only approved players can join.
/whitelist add Steve Adds a player to the whitelist.
/whitelist remove Steve Removes a player from the whitelist.
/whitelist list Lists all players on the whitelist.
/difficulty peaceful Changes the difficulty to Peaceful (no hostile mobs).
/difficulty hard Changes it to Hard (maximum damage, hunger can kill you, zombies break down doors).
/say Message for everyone Sends a message to all players in chat (as the server).
/msg Steve Hi! Sends a private message to the player Steve.
/list Lists the players online on the server.

You will find more about running a Minecraft server in our server guides. If you are looking for plugins to manage permissions, check out LuckPerms.

XP and enchantments

Manage experience points and apply enchantments with commands:

Experience: /xp and /experience

Command Description Copy
/xp add @s 1000 points Adds 1,000 experience points.
/xp add @s 30 levels Adds 30 experience levels (enough for the best enchantments).
/xp set @s 100 levels Sets your experience to exactly 100 levels.
/xp set @s 0 levels Resets your XP to zero.
/xp query @s levels Shows your current experience level.

Enchantments: /enchant

The /enchant command applies an enchantment to the item you are holding:

Command Enchantment Copy
/enchant @s sharpness 5 Sharpness V on a sword
/enchant @s efficiency 5 Efficiency V on a pickaxe
/enchant @s unbreaking 3 Unbreaking III
/enchant @s mending Mending (XP repairs the item)
/enchant @s fortune 3 Fortune III (more drops from ores)
/enchant @s silk_touch Silk Touch (blocks drop as themselves)
/enchant @s protection 4 Protection IV on armor
/enchant @s feather_falling 4 Feather Falling IV on boots
/enchant @s looting 3 Looting III (more drops from mobs)
/enchant @s infinity Infinity on a bow (a single arrow is enough)

Limitation: The /enchant command follows the normal enchantment rules: you cannot combine enchantments that exclude each other (for example Fortune + Silk Touch), and you cannot go above the maximum level (for example Sharpness V). To get around these limits, use our /give generator with NBT data or the enchantment calculator.

Useful cheat combinations

Here are ready-made sets of commands for specific situations. Enter them one after another:

Building mode (peaceful building)

  1. /gamemode creative
  2. /gamerule doDaylightCycle false
  3. /time set noon
  4. /weather clear 1000000
  5. /gamerule doWeatherCycle false
  6. /gamerule doMobSpawning false

Exploration mode (safe exploring)

  1. /gamemode survival
  2. /gamerule keepInventory true
  3. /effect give @s night_vision 9999
  4. /effect give @s fire_resistance 9999
  5. /effect give @s water_breathing 9999

Super warrior mode

  1. /effect give @s strength 9999 4
  2. /effect give @s resistance 9999 3
  3. /effect give @s speed 9999 2
  4. /effect give @s regeneration 9999 4
  5. /effect give @s fire_resistance 9999

Survival server setup

  1. /gamerule keepInventory true
  2. /gamerule mobGriefing false
  3. /gamerule doFireTick false
  4. /gamerule doInsomnia false
  5. /gamerule playersSleepingPercentage 0
  6. /difficulty normal

Target selectors: cheat sheet

Target selectors decide who a command applies to. They are the key to using cheats at an advanced level:

Selector Meaning Example
@s Me (whoever runs the command) /give @s diamond 64
@p Nearest player /tp @p 0 100 0
@a All players /effect give @a speed 60
@r Random player /give @r diamond 1
@e All entities (players + mobs + items) /kill @e[type=creeper]

Selector filters

Add filters in square brackets to narrow down the selection:

Spawning mobs: /summon

The /summon command summons any mob or entity:

Command Description Copy
/summon zombie Summons a zombie at your position
/summon skeleton Summons a skeleton
/summon creeper ~ ~ ~ Summons a creeper at your position
/summon ender_dragon Summons the Ender Dragon (a boss)
/summon wither Summons the Wither (a boss)
/summon wolf ~ ~ ~ {Owner:"Steve"} Summons a tamed wolf (Java only, NBT)
/summon lightning_bolt Summons a lightning bolt at your position
/summon tnt Summons primed TNT

You will find more advanced examples (mobs with equipment and custom attributes) in our /summon command generator.

Frequently asked questions

How do I enable cheats in Minecraft?

When you create a new world, turn on the "Allow Cheats" option (called "Allow Commands" in recent versions). In an existing world, open it to LAN (Esc → Open to LAN → Allow Cheats: ON). On a server, type /op [name] in the server console.

Do cheats disable achievements?

In Bedrock Edition, yes. Turning on cheats in a world disables achievements there, and you cannot undo it without editing the world files.

What is the difference between cheats and commands?

In Minecraft, "cheats" and "commands" are practically the same thing. Officially the game calls them commands, but players casually call them cheats or codes. You type all of them in chat after a / sign.

Can I use cheats on a multiplayer server?

Yes, but you need operator (OP) permissions or the right permissions granted by a permissions plugin (for example LuckPerms). Regular players cannot use cheats on a server unless they have been given permissions.

How do I quickly find a village or a fortress with a command?

Use /locate structure minecraft:village_plains (or another village type) to find a village, or /locate structure minecraft:fortress to find a fortress in the Nether. The game shows the coordinates of the nearest structure.

How do I undo a cheat's effect?

It depends on the command. You can switch your game mode back with /gamemode survival. You remove effects with /effect clear @s. You undo game rule changes by entering the command with the default value, for example /gamerule keepInventory false (in Java since version 1.21.11: /gamerule keep_inventory false).

More useful commands

Command Description Copy
/clear Clears your entire inventory
/clear @s diamond Removes only diamonds from your inventory
/spreadplayers 0 0 10 100 false @a Scatters players randomly around the point 0,0
/playsound minecraft:entity.wither.spawn master @a Plays the Wither spawn sound for all players
/title @a title {"text":"Hello!","color":"gold"} Shows a large "Hello!" title on every player's screen (Java only)
/particle flame ~ ~1 ~ 0.5 0.5 0.5 0.01 100 Creates a flame particle effect at your position (Java only)
/stopsound @s Stops all sounds
/worldborder set 1000 Sets the world border size to 1,000 blocks

You will find more about the /worldborder command in its own guide.

Summary

Cheats in Minecraft are a powerful tool for tailoring the game to your needs. The most important commands to remember are:

  • /gamemode: change your game mode (creative, survival, adventure, spectator)
  • /tp: teleport to coordinates or to a player
  • /give: give yourself items
  • /time set and /weather: control the time of day and the weather
  • /effect give: apply potion effects
  • /gamerule: change the rules of the world (keepInventory, mobGriefing and more)
  • /locate: find structures and biomes
  • /xp and /enchant: experience and enchantments

You can copy any command by clicking it or the "Copy" button next to it. Remember that cheats have to be enabled in the world settings, or you need OP permissions on a server.

Related guides