Discord
How to enable cheats in Minecraft

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:

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

  1. Launch Minecraft Java Edition and click Singleplayer.
  2. Click Create New World.
  3. On the Game tab, find Allow Commands. It is off by default (OFF).
  4. Click it to switch it to ON.
  5. Optional: adjust the other world settings, such as the name, game mode, seed and structures.
  6. Click Create New World.
  7. After the world loads, press T (chat) or / (the slash key, which opens chat with the / already typed).
  8. 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

  1. Launch Minecraft Bedrock Edition and click Play.
  2. Go to the Worlds tab, click Create New, then Create New World.
  3. In the settings of the new world, go to the Cheats section.
  4. Turn on the Activate Cheats toggle.
  5. 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.
  6. Adjust the other settings (world name, game mode, difficulty, seed).
  7. Click Create.
  8. 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

  1. Load the existing world where you want to enable cheats.
  2. Press Esc to open the pause menu.
  3. Click World Options (in 26.3 this button replaced Open to LAN).
  4. In the General section, set Allow Commands to ON.
  5. 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

  1. In the world, press Esc and click Options.
  2. Click World Options.
  3. 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

  1. In the world, press Esc and click Open to LAN.
  2. Set Allow Commands to ON (in versions up to 1.20.4 the option was called "Allow Cheats").
  3. Click Start LAN World.
  4. A chat message with the port number appears, and cheats are now active.
  5. 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

  1. On the world selection screen, find the world where you want to enable cheats.
  2. Click the pencil icon next to the world name, or the Edit button.
  3. In the world settings, go to the Cheats section.
  4. Turn on the Activate Cheats toggle.
  5. Confirm the Disable Achievements? warning.
  6. 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:

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:

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:

You can read more about plugins on the Minecraft plugins page.

Operator permission levels

Vanilla Minecraft Java Edition has four operator levels:

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:

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:

Step 3: Give OP from the game

If you are already an operator, you can grant operator status to other players straight from chat:

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:

  1. Quit to the main menu and click Minecraft Realms.
  2. Click Configure next to your Realm.
  3. Go to the Players tab.
  4. 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

  1. On the world list, click the pencil icon next to your Realm.
  2. In the Realm settings, find the Activate Cheats toggle.
  3. Turn it on.
  4. 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:

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.

Detailed guide: The /gamemode command

2. /tp (teleport): teleporting

Moves a player to the given coordinates or to another player.

Detailed guide: The /teleport command

3. /give: get any item

Adds an item to a player's inventory.

Detailed guide: The /give command

4. /time: control the time

Changes the time of day in the world.

5. /weather: control the weather

Changes the weather in the world.

6. /difficulty: change the difficulty

Changes the game difficulty without restarting the world.

7. /locate: find structures

Shows the coordinates of the nearest structure, which is handy for finding a village, a stronghold or a temple.

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!

9. /effect: potion effects

Gives a player a potion effect without having to brew anything.

Detailed guide: The /effect command

10. /gamerule: world rules

Changes the rules the world runs by. It is an extremely powerful command.

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

Problem: "You do not have permission"

Problem: Commands work, but the command block does not

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

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