How to Change Gamemode in Minecraft Java Edition
Minecraft Java Edition gives players direct control over how they experience the game — and one of the most powerful tools for that is the gamemode command. Whether you're building without limits, testing mechanics, or setting up a multiplayer server, understanding how to switch gamemodes quickly and correctly makes a real difference.
What Is a Gamemode in Minecraft Java?
A gamemode determines the rules your character plays by. Minecraft Java Edition includes four distinct modes:
| Gamemode | Name | What It Does |
|---|---|---|
| 0 | Survival | Health, hunger, resource gathering, death penalties |
| 1 | Creative | Unlimited blocks, flying, no damage |
| 2 | Adventure | Restricted block breaking — designed for custom maps |
| 3 | Spectator | Fly through the world invisibly, no interaction |
Each mode serves a different purpose, and Java Edition lets you switch between them using in-game commands — no mods required.
How to Change Your Own Gamemode
Step 1: Enable Cheats or Use a Server with Operator Permissions
Before any gamemode command works, cheats must be enabled. How you do that depends on your setup:
- Single-player world: When creating a world, toggle "Allow Cheats" to ON. For an existing world, open the world to LAN (press Escape → Open to LAN → enable cheats) — this applies only for that session.
- Multiplayer server: You need operator (op) status. A server admin grants this using
/op [username]from the server console.
Without these permissions, the gamemode command will be blocked.
Step 2: Open the Chat/Command Window
Press T or / on your keyboard to open the chat window. Using / will pre-fill the slash character so you can type the command directly.
Step 3: Type the Command
The basic syntax is:
/gamemode <mode> You can use either the mode name or its numeric alias:
/gamemode creative /gamemode survival /gamemode adventure /gamemode spectator Or shorthand versions that Java also accepts:
/gamemode c (creative) /gamemode s (survival) /gamemode a (adventure) /gamemode sp (spectator) Hit Enter and the switch takes effect immediately. You'll see a confirmation message in chat.
How to Change Another Player's Gamemode 🎮
On multiplayer servers, operators can change gamemode for other players by adding a username to the command:
/gamemode creative PlayerName This is useful for server admins managing player experiences — for example, giving a builder Creative mode while keeping other players in Survival.
Changing the Default Gamemode for a World or Server
If you want every new player (or every session) to start in a specific mode, you have a couple of options:
Single-Player Worlds
Use the default game mode setting in world creation. You can also change it mid-game using:
/defaultgamemode <mode> This doesn't change your current mode — it sets what mode new players (or you on respawn in some configurations) will spawn into.
Multiplayer Servers
In your server.properties file, find the line:
gamemode=survival Change survival to creative, adventure, or spectator as needed, then restart the server. This sets the default for all incoming players.
Key Variables That Affect How This Works
Not every setup behaves identically. A few factors shape your experience:
- Java version: Command syntax has evolved across versions. The numeric aliases (
/gamemode 0,/gamemode 1) were officially deprecated in Java Edition 1.13 during the "Flattening" update. On older versions, numeric IDs still work. On 1.13 and later, use text names. - Operator permission level: On servers, operators are assigned permission levels (1–4). Gamemode changes typically require level 2 or above. A server owner sets these in the
ops.jsonfile. - Realm vs. dedicated server vs. LAN: Realms have their own admin panel for gamemode settings. A dedicated server uses
server.properties. A LAN world requires cheats enabled per session. - Hardcore mode: A world created in Hardcore mode locks the difficulty — you cannot switch to a different gamemode through standard commands unless you use external tools or NBT editing. Hardcore is a separate world flag, not just a gamemode setting.
Common Mistakes and Why Commands Fail
- "I don't have permission" — Cheats aren't enabled, or you're not opped on the server.
- "Unknown command" — You may be running a very old Java version with different syntax, or you've mistyped the mode name.
- Gamemode resets on rejoin — The server's
defaultgamemodeinserver.propertiesis overwriting your mode on each login. Adjust that setting to match what you want, or use a permissions plugin to lock individual players to specific modes. - LAN changes don't persist — Enabling cheats via Open to LAN only lasts for that play session. You'll need to repeat it each time unless you edit the world's
level.datdirectly.
The Difference Between Java and Bedrock Syntax ⚠️
If you've played Bedrock Edition, note that Java uses slightly different command structures. Bedrock uses /gamemode 0 through /gamemode 6 and has additional modes like Spectator only available in certain versions. If instructions you find online aren't working, confirm they're written for Java Edition specifically — the two editions are not interchangeable in their command syntax.
How Your Setup Shapes the Right Approach
The steps above cover the mechanics, but the actual workflow that makes sense for you depends on what you're doing with the game. A solo builder working in Creative on a local world has very different needs than a server admin managing dozens of players across multiple modes. The version you're running, whether you're on a Realm or a self-hosted server, and what level of permissions you've been granted all determine which steps apply and in what order.
Understanding the commands is the easy part — the configuration layer underneath is what varies from one setup to the next. 🔧