How to enable cheats (commands) in Minecraft: a step-by-step guide
To teleport across the map, switch to Creative mode or make it rain diamonds, you need cheats, also known as commands: text instructions you type into the in-game chat. This guide shows step by step how to enable them in Minecraft Java Edition and Bedrock Edition in every scenario: a new world, an existing world, a multiplayer server and Realms.
A quick note on terms: in Minecraft, cheats, commands and codes all mean exactly the same thing. The official term is commands. In Java Edition the menu option is called "Allow Commands", and in Bedrock Edition it is "Activate Cheats". Players casually say commands, cheats or codes, and this page uses the terms interchangeably.
What are cheats in Minecraft?
Cheats (commands, codes) are text instructions you type into the game chat to change the world, manage players and do things that are not possible in normal gameplay. Every command starts with a slash /. For example, /gamemode creative switches you to Creative mode.
Commands have a huge range of uses. Here are a few examples of what you can do with them:
- Changing game mode: switch between Survival, Creative, Adventure and Spectator without creating a new world
- Teleporting: instantly jump to any coordinates or to another player
- Getting items: add any item to your inventory, including rare materials and enchanted tools
- Controlling time and weather: set the time of day, turn off rain, stop the day and night cycle
- Summoning mobs: create any creature, from a chicken to the Wither
- Managing a server: grant permissions, ban players, set world borders
- Building: fill and clone large areas with blocks using a single command
For commands to work, you need the right permissions. In singleplayer it is enough to allow commands (turn on cheats). On a multiplayer server you need operator (OP) status or permissions granted by a plugin. Below you will find instructions for each scenario.
You can read more about the available commands on the Minecraft commands page.
New world: Java Edition
Enabling cheats while you create a new world in Java Edition is the simplest way. The option is right on the world setup screen.
Step by step
- Launch Minecraft Java Edition and click Singleplayer.
- Click Create New World.
- On the Game tab, find Allow Commands. It is off by default (OFF).
- Click it to switch it to ON.
- Optional: adjust the other world settings, such as the name, game mode, seed and structures.
- Click Create New World.
- After the world loads, press T (chat) or / (the slash key, which opens chat with the
/already typed). - Type your first command, for example
/gamemode creative, and press Enter.
Note: since Java 1.19.4 the world creation screen has three tabs: Game, World and More. In older versions everything was on a single screen. Up to version 1.20.4 the option was called "Allow Cheats", and from 1.20.5 it is "Allow Commands".
Tip: in Hardcore mode you cannot allow commands, because the button is disabled. You can set game rules such as keep inventory without commands on the More tab, under Game Rules.
New world: Bedrock Edition
Bedrock Edition (Windows, Xbox, PlayStation, Nintendo Switch, iOS, Android) has a similar option, but the interface looks different from Java. Here is how to enable cheats:
Step by step
- Launch Minecraft Bedrock Edition and click Play.
- Go to the Worlds tab, click Create New, then Create New World.
- In the settings of the new world, go to the Cheats section.
- Turn on the Activate Cheats toggle.
- A Disable Achievements? prompt appears, explaining that achievements are only available in Survival worlds with cheats turned off. Confirm if you want to use commands.
- Adjust the other settings (world name, game mode, difficulty, seed).
- Click Create.
- In the game, press T (on PC) or the chat icon (on a console or phone) and type a command, for example
/tp ~ ~50 ~to teleport 50 blocks up.
Important: in Bedrock Edition, enabling cheats is irreversible for achievements in that world. Even if you turn the toggle off later, achievements do not come back. So think twice before enabling cheats in a world where you want to earn achievements.
Controllers: on consoles (Xbox, PlayStation, Switch) you open chat with the D-pad (usually right). On mobile devices the chat icon is at the top of the screen.
Existing world: Java Edition
If you created a world with commands off and want to turn them on now, you do not have to create a new world or install mods in Java Edition. The method depends on your game version, which is shown in the bottom left corner of the main menu.
Java 26.3 and newer: World Options
- Load the existing world where you want to enable cheats.
- Press Esc to open the pause menu.
- Click World Options (in 26.3 this button replaced Open to LAN).
- In the General section, set Allow Commands to ON.
- Go back to the game and type any command in chat, for example
/time set day.
The same screen has an Edit Game Rules button. The Multiplayer section has the options for sharing your world: LAN, Port Number and Command Access for players who join your world.
Java 26.2: World Options in the Options menu
- In the world, press Esc and click Options.
- Click World Options.
- Set Allow Commands to ON.
In version 26.2, the commands toggle on the LAN sharing screen only affects players who join your world. You turn on your own commands in World Options.
Java 26.1 and older: Open to LAN
- In the world, press Esc and click Open to LAN.
- Set Allow Commands to ON (in versions up to 1.20.4 the option was called "Allow Cheats").
- Click Start LAN World.
- A chat message with the port number appears, and cheats are now active.
- Type any command in chat, for example
/time set day.
Important: cheats enabled this way work only until you close the world. When you quit and come back, you have to open the world to LAN again. It is a temporary workaround, but enough for one-off tweaks.
Game rules without commands: since Java 26.1 you can also change game rules from the menu: World Options, then Edit Game Rules (in 26.1 and 26.2 the World Options button is in the Options menu). This screen is only available to operators, so allow commands first.
LAN from chat: once commands are on, you can also open your world to LAN with the /publish command and close sharing with /unpublish (Java 26.2 and newer).
Existing world: Bedrock Edition
In Bedrock Edition you can enable cheats in an existing world right from its settings. You do not need any workarounds like in Java Edition.
Step by step
- On the world selection screen, find the world where you want to enable cheats.
- Click the pencil icon next to the world name, or the Edit button.
- In the world settings, go to the Cheats section.
- Turn on the Activate Cheats toggle.
- Confirm the Disable Achievements? warning.
- Go back to the game and use commands in chat.
You can also find the Cheats section while playing, in the settings opened from the pause menu. It also holds game rules that are only available with cheats on, for example Keep Inventory.
Remember: just like when you create a new world, enabling cheats in Bedrock Edition permanently disables achievements in that particular world. If you care about achievements, back up the world before turning on cheats, so you can go back to a version without them if you need to.
Console backups: on Xbox you can copy a world in the game settings. On PlayStation, use PlayStation Plus cloud storage or a USB drive. On Nintendo Switch, use Nintendo Switch Online.
Server: Java Edition
On a multiplayer server, commands work differently than in singleplayer. There is no "enable cheats" option. Instead you manage operator permissions and the server configuration.
Step 1: Configure server.properties
The server.properties file is in the server's main directory. Open it in a text editor and check these settings:
enable-command-block=true: allows command blocks.falseby default.op-permission-level=4: sets the operator permission level (1-4). Level 4 gives full access to all commands.
After changing the settings, save the file and restart the server for the changes to take effect.
Step 2: Give operator status
For a player to use commands on the server, they need operator (OP) status. There are three ways to grant it:
- From the server console: type
op PlayerName(no slash) in the server console. - From the game: if you are already an operator, type
/op PlayerNamein chat. - The ops.json file: you can edit
ops.jsonin the server directory by hand and add the player's UUID with the right permission level.
Step 3: Manage permissions (advanced)
On servers running Bukkit, Spigot, Paper or Purpur you can control precisely who has access to which commands. Permission plugins handle that:
- LuckPerms: the most popular and most feature-rich permissions plugin. It lets you create groups (for example Moderator, Admin), grant permissions for individual commands and set time limits on access.
- PermissionsEx (PEX): an older plugin, still used on many servers, although LuckPerms is the recommended choice today.
You can read more about plugins on the Minecraft plugins page.
Operator permission levels
Vanilla Minecraft Java Edition has four operator levels:
- Level 1: can bypass spawn protection.
- Level 2: can use the singleplayer commands:
/clear,/difficulty,/effect,/gamemode,/give,/summon,/teleport,/time,/weatherand others. - Level 3: can use the multiplayer commands:
/ban,/kick,/op,/deop,/whitelist. - Level 4: full access, including
/stop(stops the server) and/save-all.
Server: Bedrock Edition
Bedrock Dedicated Server (BDS) has a slightly different permission system than Java Edition.
Step 1: The permissions.json file
The BDS server directory contains a permissions.json file. Add players to it with the right permission level:
- visitor: a guest who can only look around and chat.
- member: a regular player who can build and break blocks.
- operator: full command access, including
/op,/gamemode,/giveand so on.
File format (JSON):
[
{"permission": "operator", "xuid": "YOUR_XUID_HERE"}
] The XUID is the ID of an Xbox Live account. You can look it up on sites such as mcprofile.net or cxkes.me/xbox/xuid.
Step 2: Configure server.properties (BDS)
Also check the BDS server.properties file:
allow-cheats=true: enables commands on the server.falseby default.default-player-permission-level=member: the default permission level for new players.
Step 3: Give OP from the game
If you are already an operator, you can grant operator status to other players straight from chat:
/op PlayerName: grants operator status./deop PlayerName: removes operator status.
Minecraft Realms
Minecraft Realms is Mojang's official server hosting service. Enabling cheats on Realms is simple, but it requires owner permissions.
Realms: Java Edition
A Realm in Java Edition has no cheats toggle. Commands are used by operators, and the Realm owner is an operator, so they can use commands right away. Here is how to give that status to other players:
- Quit to the main menu and click Minecraft Realms.
- Click Configure next to your Realm.
- Go to the Players tab.
- Next to the chosen player, change their permission to Operator.
You can grant and remove operator status on a Java Edition Realm only in this menu, so quit to the main menu first. Note that during a minigame on a Realm nobody, not even the owner, has permission to use commands.
Realms: Bedrock Edition
- On the world list, click the pencil icon next to your Realm.
- In the Realm settings, find the Activate Cheats toggle.
- Turn it on.
- Confirm the achievements warning (on Bedrock Realms, achievements are disabled as well).
Realms Plus (Bedrock) works the same way. The difference between Realms and Realms Plus is the extra access to a catalog of maps and texture packs. The permission and cheats system is the same.
Effect on achievements: Java vs. Bedrock
This is one of the most important differences between the editions, and worth knowing before you enable cheats:
Java Edition: no effect on achievements
In Java Edition the achievement system is called advancements. Advancements work independently of cheats, so you can earn them even with commands enabled. There is one catch: granting an advancement with a command (for example /advancement grant) is obviously cheating, but the game allows it and does not block further advancements.
In Hardcore mode you cannot allow commands when creating the world. In Java 26.1 and older you could still turn them on through Open to LAN, but since Java 26.2 the game does not allow that: in World Options the Allow Commands button is disabled, with the message "Cannot allow commands in a hardcore world." On a server in hardcore mode, operators can still use commands.
Bedrock Edition: achievements are permanently disabled
In Bedrock Edition the achievement system is called Achievements (similar to Xbox achievements). Enabling cheats permanently disables achievements in that world, even if you turn the "Activate Cheats" toggle off later. The decision cannot be undone.
Tips for Bedrock players:
- Always back up your world before enabling cheats.
- If you want to try out commands, create a separate test world instead of risking achievements on your main save.
- On consoles (Xbox, PlayStation), achievements are tied to your account. Disabling them in one world does not affect other worlds.
10 essential commands to start with
With cheats on, these ten commands are a good place to start. Each of them works in both Java Edition and Bedrock Edition (with minor syntax differences).
1. /gamemode: change your game mode
Switches your game mode without having to create a new world.
/gamemode creative: Creative mode (unlimited resources, flying)/gamemode survival: Survival mode/gamemode spectator: Spectator mode (pass through blocks, invisibility)/gamemode adventure: Adventure mode (you cannot break blocks by hand)
Detailed guide: The /gamemode command
2. /tp (teleport): teleporting
Moves a player to the given coordinates or to another player.
/tp 100 64 200: teleports you to X=100, Y=64, Z=200/tp PlayerName: teleports you to another player/tp ~ ~50 ~: moves you 50 blocks up (the tilde means relative coordinates)
Detailed guide: The /teleport command
3. /give: get any item
Adds an item to a player's inventory.
/give @s diamond 64: gives you 64 diamonds/give @s netherite_sword 1: gives you a netherite sword/give @s golden_apple 16: gives you 16 golden apples
Detailed guide: The /give command
4. /time: control the time
Changes the time of day in the world.
/time set day: sets the time to day (1000 ticks)/time set night: sets the time to night (13000 ticks)/time set noon: sets the time to noon (6000 ticks)/time add 6000: moves time forward by 6000 ticks
5. /weather: control the weather
Changes the weather in the world.
/weather clear: clear skies/weather rain: rain/weather thunder: a thunderstorm/weather clear 999999: clear skies for a very long time (in ticks)
6. /difficulty: change the difficulty
Changes the game difficulty without restarting the world.
/difficulty peaceful: Peaceful (no hostile mobs, health regenerates)/difficulty easy: Easy/difficulty normal: Normal/difficulty hard: Hard
7. /locate: find structures
Shows the coordinates of the nearest structure, which is handy for finding a village, a stronghold or a temple.
/locate structure minecraft:village_plains(Java): the nearest plains village/locate structure village(Bedrock): the nearest village/locate structure minecraft:stronghold: the nearest stronghold (End portal)/locate structure minecraft:fortress: the nearest Nether fortress
Tip: after the game finds a structure, you can teleport to it by clicking the coordinates in chat (Java Edition).
8. /kill: remove entities
Instantly kills the target. Use with care!
/kill @s: kills you (you respawn at your spawn point)/kill @e[type=zombie]: kills all zombies/kill @e[type=!player]: kills every entity except players
9. /effect: potion effects
Gives a player a potion effect without having to brew anything.
/effect give @s speed 600 2: Speed III for 10 minutes/effect give @s night_vision 9999: Night Vision for a very long time/effect give @s strength 300 1: Strength II for 5 minutes/effect clear @s: removes all effects
Detailed guide: The /effect command
10. /gamerule: world rules
Changes the rules the world runs by. It is an extremely powerful command.
/gamerule keep_inventory true: keep inventory, meaning you keep your items after death (a player favorite!)/gamerule advance_time false: stops the day and night cycle/gamerule spawn_mobs false: turns off natural mob spawning/gamerule advance_weather false: stops weather changes/gamerule mob_griefing false: mobs do not destroy blocks (creepers explode, but the blocks stay)
These names apply to Java 1.21.11 and newer. In older Java versions the rules are called keepInventory, doDaylightCycle, doMobSpawning, doWeatherCycle and mobGriefing, and in Bedrock keepinventory, dodaylightcycle, domobspawning, doweathercycle and mobgriefing. You will find the full table of names on the /gamerule command page.
Once you have mastered these ten commands, you will have full control of your world. You will find the full list of commands with descriptions on the Minecraft commands page.
Troubleshooting
If cheats are not working, these are the most common problems and their fixes:
Problem: "Unknown or incomplete command" or no effect
- Missing slash: every command must start with
/. If you press T and type "gamemode creative" without the slash, the game treats it as a chat message. - Typo: commands must be typed exactly. "/gamemoed" will not work. Use Tab completion, which fills in commands for you.
- Java vs. Bedrock difference: some commands have different syntax. For example, it is
/locate structure minecraft:village_plainsin Java but/locate structure villagein Bedrock.
Problem: "You do not have permission"
- Singleplayer: make sure commands are enabled (Java 26.2 and newer: World Options, Java 26.1 and older: Open to LAN, Bedrock: the Cheats section).
- Server: you need operator status. Ask an admin to give you OP or the right permissions through a plugin.
- OP level: some commands need a higher operator level. For example,
/stoprequires level 4.
Problem: Commands work, but the command block does not
- Check that
server.propertieshasenable-command-block=true. - Make sure the command block is powered by a redstone signal (or set to Always Active).
- The command block must be in a loaded chunk.
Problem: Tab does not suggest commands
If the Tab key does not show command suggestions, you most likely do not have command permissions on that server. In singleplayer, check that cheats are enabled.
Problem: The command works, but the result is not what you expected
- Target selectors:
@sis you,@pis the nearest player,@ais all players,@eis all entities and@ris a random player. Make sure you use the right selector. - Relative coordinates: the tilde
~means "from my position"./tp ~ ~50 ~teleports you 50 blocks up, not to Y=50. - Item IDs: use the item ID, such as
diamond_sword(orminecraft:diamond_sword). Item names as displayed in the game, like Diamond Sword, do not work in commands.
Frequently asked questions (FAQ)
Can I enable cheats in an existing Minecraft world?
Yes. In Java 26.3 and newer, press Esc, click World Options and turn on Allow Commands. In Java 26.2 the same option is under Options, World Options. In Java 26.1 and older, click Open to LAN, turn on Allow Commands and click Start LAN World. In Bedrock Edition, open the world settings and turn on Activate Cheats in the Cheats section. Note that in Bedrock this also turns off achievements in that world.
Does enabling cheats disable achievements?
In Bedrock Edition, yes, permanently and irreversibly. In Java Edition, no. Advancements work independently of cheats, so you can earn them even with commands enabled. It is one of the biggest differences between the editions.
How do I enable cheats on a Minecraft server?
A Java server has no cheats toggle, because commands are used by operators. Give yourself operator status with the op PlayerName command in the server console (no slash) or by editing ops.json. The enable-command-block=true option in server.properties only enables command blocks. On a Bedrock server (BDS), set allow-cheats=true in server.properties and assign permissions in the permissions.json file.
What is the difference between cheats, codes and commands?
None, they are synonyms. The official term is commands. Players casually say commands, cheats or codes. In the game menu the option is called Allow Commands (Java) or Activate Cheats (Bedrock). All these terms mean the ability to type commands into chat.
Do cheats work in Survival mode?
Yes. Commands work in every game mode (Survival, Creative, Adventure and Spectator) as long as commands are enabled (in singleplayer) or you are an operator (on a server). Your game mode does not limit access to commands.
How do I enable cheats in Minecraft Realms?
In Java Edition, a Realm has no cheats toggle: the Realm owner is an operator and can use commands right away, and can give other players operator status in the Configure menu, on the Players tab. You can only open that menu from the main menu, not during the game. In Bedrock Edition, the owner turns on the Activate Cheats toggle in the Realm settings.
Can I turn cheats off after enabling them?
Yes. In Java 26.2 and newer, turn them off with the Allow Commands toggle in World Options. In Java 26.1 and older, commands enabled through Open to LAN turn off on their own when you close the world. In Bedrock Edition you can turn off Activate Cheats, but the achievements in that world will not come back. On servers, an operator can take away permissions with the /deop command.
Why doesn't my command work even though cheats are on?
The most common causes are a missing slash at the start, a typo in the command name, Java syntax used in Bedrock (or the other way round), missing permissions on the server, wrong arguments or the wrong target selector. Also check that you are typing the command in chat (T) and not in a search field. Press Tab while typing and the game will suggest available commands and arguments.
See also
- Minecraft commands: the complete list: all commands with descriptions
- The /gamemode command: a detailed guide to changing your game mode
- The /teleport command: teleporting to coordinates and players
- The /give command: getting items
- The /effect command: applying potion effects
- The /fill command: filling areas with blocks
- The /summon command: summoning mobs and entities
- Potion brewing guide: making potions without commands
- Minecraft guides: guides for beginners and advanced players
- Tools and generators: interactive command generators