Minecraft

How to Change Gamemode on a Minecraft Server

Switch one player to Creative in seconds, or change the default mode for everyone who joins. Every command works from the server console.

TheGameHosting Team 6 min read
Change Gamemode in Minecraft
Background: Minecraft © Mojang Studios

To change gamemode on a Minecraft server, type gamemode creative PlayerName in the server console (or /gamemode creative in chat if you are OP). To change the mode new players get, set gamemode= in server.properties, and add force-gamemode=true if you want every player put back in that mode each time they join. This guide covers both, plus the errors people hit most.

Everything here applies to Java Edition servers running Vanilla, Paper, Purpur, Fabric or Forge. The four modes are survival, creative, adventure and spectator. Hardcore is not a gamemode you can switch to; it is a world setting.

Change gamemode for one player

The /gamemode command changes the mode of a single player right away, with no restart. It needs permission level 2, so in chat only an operator can use it. If you are not OP yet, see how to OP yourself on a Minecraft server.

  1. Open the server console. On TheGameHosting, open your server in the panel and click Console. Commands there run with full rights and need no slash.
  2. Type gamemode creative PlayerName and press Enter. Use the exact Java username.
  3. Check the reply in the console. It confirms the new mode for that player.
  4. To switch the player back, type gamemode survival PlayerName.
  5. To change your own mode in game, type /gamemode creative in chat. With no name, the command applies to you.
Server console
gamemode creative Steve
gamemode survival Steve
gamemode spectator @a
gamemode adventure @a[distance=..20]

Since Java 1.13, the command only accepts the mode names. The old numbers (gamemode 1) and letters (gamemode c) work on Bedrock but give an error on Java. Selectors such as @a (all players) and @p (nearest player) also work, which is handy for events.

ModeCommandWhat players can do
Survivalgamemode survivalMine, build, take damage and need food
Creativegamemode creativeFly, unlimited blocks, no damage
Adventuregamemode adventurePlay maps; cannot break or place blocks freely
Spectatorgamemode spectatorFly through blocks and watch; cannot interact

An operator can also open the game mode switcher with F3 + F4 in game and cycle modes with F4.

Change the default gamemode on a Minecraft server

The default gamemode is the mode a player gets the first time they join. It lives in server.properties as gamemode, with survival as the value in a new file.

  1. Stop the server from the panel, or keep it running and restart at the end.
  2. Open Files and click server.properties in the main folder.
  3. Change the line to the mode you want, for example gamemode=creative.
  4. If you also want players who already joined to switch, set force-gamemode=true.
  5. Save the file and restart the server.
server.properties
gamemode=creative
force-gamemode=true

You can also run defaultgamemode creative in the console. It changes the default without a restart, but check that server.properties says the same mode, so you know what the server will use after the next restart.

force-gamemode explained

This is the setting that confuses most server owners. The server saves each player's mode in their player data. When you change gamemode= in server.properties, only new players get it; players who already joined keep the mode they had.

force-gamemodeWhat happens when a player joins
false (default)They keep the mode they had when they left
trueThey are put in the default gamemode every time

Use force-gamemode=true on a lobby, a minigame server or a survival server where you never want someone stuck in Creative after an event. Leave it on false on a build server where staff switch modes all the time, or they will be sent back to the default each time they reconnect.

Hardcore and adventure servers

Hardcore is not a value of gamemode. It is set with hardcore=true in server.properties, and the setting only takes effect on a newly created world. To start a hardcore server, back up and rename or remove the old world folder from Files, set hardcore=true, and start the server so it makes a new world. Take a backup from Backups first, because the old world is gone if you skip it.

For a map with rules (parkour, escape rooms), set gamemode=adventure and force-gamemode=true, so players cannot break blocks and always come back in Adventure.

Common problems when you change the gamemode

  1. "Unknown or incomplete command". You typed a number or a letter. Use the full name: gamemode creative.
  2. "You do not have permission". Only operators with level 2 or higher can use it in chat. Run it from the console or OP the player.
  3. The default mode did nothing. Players who already joined keep their saved mode. Set force-gamemode=true or switch them one by one with /gamemode.
  4. The change was lost after a restart. You used the command but server.properties still has the old value. Edit the file and restart.
  5. A plugin switches players back. Lobby and world plugins (multi-world, minigames) can set their own mode per world. Check their config files too.
  6. Testing deaths in Creative. Creative players never lose items, so a test in Creative tells you nothing about death drops. See keep inventory on a Minecraft server for that rule.

Run your server with the mode you want, on TheGameHosting

On your own PC, every change means editing files by hand and the world closes when the computer turns off. On TheGameHosting you do it in one panel: Console for gamemode and defaultgamemode, Files to edit server.properties, and Backups to save the world before you test a hardcore setup. The server runs on AMD 9950X or 7950X3D CPUs with NVMe storage in Dallas or Amsterdam, stays online 24/7 and includes DDoS protection on every plan.

A small Java server starts with the 2 GB plan at $1.90 USD per month, ready about 60 seconds after payment, with no charge per player. See the plans on Pricing or read more about our Minecraft server hosting. If you also want to fine-tune the world, our guide on changing the view distance is a good next step.

FAQ

How do I change the default gamemode on my Minecraft server?

Set gamemode=creative (or another mode) in server.properties and restart. New players get that mode; add force-gamemode=true if players who already joined should switch too.

Why does my gamemode change back when I rejoin?

The server has force-gamemode=true, so it puts every player in the default mode on join. Set it to false and restart if you want players to keep their mode.

Can I use /gamemode 1 on a Java server?

No. Java Edition only accepts the names survival, creative, adventure and spectator. Numbers and letters only work on Bedrock.

How do I make my Minecraft server hardcore?

Set hardcore=true in server.properties and generate a new world. The setting does not convert an existing world, so back it up first.

Hosting for this game

Written by TheGameHosting Team, the people who run our servers in Dallas and Amsterdam and answer your tickets.

All posts