The /gamemode Command in Minecraft: Creative, Survival and Spectator
/gamemode changes the game mode: from survival to creative to build without limits, to spectator to watch without being seen, or to adventure for a map where nothing can be broken. It's the first command almost everyone setting up a server looks for. Here's how it's written today in Java, how to set a fixed mode for everyone and why the shortcuts from old videos no longer work.
How to write it
The shape is /gamemode <mode> <player>, and the player is optional: without it, the change is for you. The four modes are written in English: survival, creative, adventure and spectator.
You need to be an operator (level 2) or have cheats turned on in a single-player world. On a server, you make yourself op from the console with op YourName (the op guide).
When it works, the game answers «Set own game mode to Creative Mode» and, if you change someone else's, they see «Your game mode has been updated to Creative Mode».
Creative
/gamemode creative: you fly, you have every block in your inventory and nothing hurts you. For building.Survival
/gamemode survival: the normal mode, with health, hunger and whatever you gather yourself.Adventure
/gamemode adventure: like survival, but without breaking or placing blocks. It's the one for adventure maps and lobbies, so nobody wrecks anything.Spectator
/gamemode spectator: you go through blocks, nobody sees you and you don't touch anything. Left-click a player or a mob to see what they see.
Rather not set it up yourself? Minecraft servers from €6 a month, no contract and a full refund within 72 hours. Or create a free Minecraft server, no card needed.
Changing it for another player or for everyone
For one player
/gamemode creative Anaputs Ana in creative. She has to be online.For everyone
/gamemode survival @aswitches everyone online to survival, you included. Before an event, so nobody starts with an advantage.For everyone but you
/gamemode adventure @a[name=!YourName]. The options in square brackets are the usual ones: the selectors guide (in Spanish).Only those in creative
/gamemode survival @a[gamemode=creative]puts back in survival anyone left in creative, and leaves spectators as they are.
Why /gamemode 1 and /gamemode c don't work
Lots of videos show /gamemode 1 or /gamemode c. That worked up to 1.12: since 1.13 it only takes the full name, and with a number or a letter the game answers «Unknown game mode '1'».
If it tells you that you don't have permission or that the command doesn't exist, you're not an operator. In a single-player world, open the world to LAN with cheats on, or create it with cheats on.
And if you're on a server with plugins and the command does something different from what this guide says, see the EssentialsX section below.
With the keyboard: F3 + F4 and F3 + N
F3 + F4 opens a menu to pick the mode: while you hold F3, each press of F4 moves to the next one and, when you let go, it switches. F3 + N toggles between the mode you had and spectator, and back again.
Both need the same as the command: being an operator. Without permission, the game says «Unable to open game mode switcher; no permission».
The mode new players join in: /defaultgamemode and server.properties
/gamemode changes whoever is already there. To choose the mode people join in the first time there's /defaultgamemode creative, which answers «The default game mode is now Creative Mode». Anyone who had joined before stays in the mode they left in.
The same thing, saved on the server, is gamemode in server.properties (the server.properties guide). For everyone to always join in that mode, even if they left in another, there's force-gamemode=true: it's what a creative server or an adventure-mode lobby uses. With it on, /defaultgamemode also changes those who are online.
Hardcore isn't a /gamemode mode: it's hardcore=true in server.properties, and whoever dies becomes a spectator with no way back. How to set it up properly, in the hardcore server guide.
Letting someone change mode without making them op
Being op gives every command at once. If you only want a builder to be able to switch to creative, on Paper the minecraft.command.gamemode permission is enough, given with LuckPerms: lp user Ana permission set minecraft.command.gamemode true.
How to set up groups and ranks with that, in the LuckPerms guide, and the commands ready to copy in the LuckPerms commands generator.
If you have EssentialsX
EssentialsX brings its own /gamemode and takes over the name, with shorter shortcuts: /gmc (creative), /gms (survival), /gma (adventure) and /gmsp (spectator), and also plain /creative or /survival. Its permission is essentials.gamemode.
To use the game's one, type its prefix: /minecraft:gamemode creative Ana. It always goes to Minecraft's command, whatever plugins you have. EssentialsX's other commands, in its guide.
From the server console
In the console you write it without the slash and always with the player: gamemode creative Ana. Without a name it doesn't know whose mode to change, because the console isn't a player.
That way you can get someone stuck in spectator mode out of it, or put yourself in creative, without anyone else needing to be op.
On NapNodes
Minecraft servers run Paper on the latest version, so everything in this guide works. From the panel's «Console» you run any /gamemode without being in the game.
The mode new players join in is under «Settings» → «The game»: «Game mode», «Force game mode on join» and «Hardcore». Each setting saves on its own and applies on restart.
Frequently asked questions
What's the command for creative mode in Minecraft?
/gamemode creative. To set it for another player, /gamemode creative and their name. You need to be an operator or have cheats turned on.
Why doesn't /gamemode 1 work?
Because the numbers and letters were removed in 1.13. Today you write the full mode name: survival, creative, adventure or spectator.
How do I put everyone in survival?
With /gamemode survival @a, which changes everyone online. For those who join later, change the default mode too with /defaultgamemode survival.
How do I make everyone always join in creative?
Set gamemode=creative and force-gamemode=true in server.properties and restart. That way everyone switches to creative on joining, even if they left in another mode.
What is adventure mode for?
It's like survival but without being able to break or place blocks. It's used on adventure maps and lobbies so nobody wrecks anything.
How do I let someone use /gamemode without making them op?
On Paper, give them the minecraft.command.gamemode permission with LuckPerms. With EssentialsX, the permission is essentials.gamemode.
Shall we set it up for you?
Minecraft servers from €6 a month, never oversold: your RAM is yours alone. And if you'd rather start without paying, there's a free Minecraft server, no card needed.
Your server doesn't show up in the game? Check it in a second with “Is my Minecraft server online?”: players, version and MOTD, free. Need a player's UUID for the whitelist or permissions? Look it up here. Handing out enchanted items? Build the command with the /give generator.
Keep reading
- How to Put Your Minecraft Server in Creative (and Change the Difficulty)
Put your Minecraft server in creative, survival or adventure for everyone or one player, lock it with force-gamemode and change the difficulty so it sticks.
- Multiple Worlds on a Minecraft Server with Multiverse: Survival, Creative and Minigames at Once
Run survival, creative and a resource world on the same Minecraft server with Multiverse-Core: create, import, move between them and how much RAM it needs.
- The /enchant Command in Minecraft: Enchanting With Commands, the Errors and Going Past the Max Level
How to use /enchant in Minecraft, why it fails (level, item, incompatible enchantments) and how to give Sharpness 10 or enchanted books with /give instead.