The mode is written into the world as its default. Only players who have never joined before receive it; everyone else keeps their current per-player game mode.
Run from chat as an operator (permission level 2), from the server console, or in a command block. In singleplayer the world needs cheats enabled.
/defaultgamemode does not touch anyone who has already played in the world. To move current players into the same mode, run a /gamemode command as well.
Quick rule: /defaultgamemode decides what future first-time joiners get; /gamemode changes a specific player right now. Need the per-player version with full target options? Use the Gamemode Command Generator.
/defaultgamemode sets the game mode that brand new players receive the first time they join a world. It changes a world setting, not any player: everyone who has already played keeps their personal game mode until a /gamemode command says otherwise.
The setting lives with the world itself, in the same place the world default game mode is stored, so it survives restarts and keeps applying to every future first-time joiner. That makes /defaultgamemode a server-admin command at heart: it is how you decide whether the next stranger who connects spawns ready to survive, build, follow your map rules or just watch.
Running it requires permission level 2 (the gamemasters level): an operator account or the console on a server, cheats enabled in singleplayer or on a LAN world, or a command block. The command takes exactly one argument, the game mode, and nothing else; there is no target, no coordinates and no extra options.
The two commands sound interchangeable but solve different problems, and mixing them up is the most common reason /defaultgamemode "does not work":
In practice you often want both: set the default for future joiners, then run /gamemode <mode> @a once so the people already online match. The generator above produces that companion command for you.
Copy any of these straight into chat or a console:
/defaultgamemode survivalThe standard setup: everyone who joins the world for the first time starts in Survival.
/defaultgamemode creativeFor building servers and test worlds, so new players spawn with unlimited blocks and flight.
/defaultgamemode adventureFor adventure maps: first-time joiners cannot break or place blocks freely, which protects the build.
/defaultgamemode spectatorFor event lobbies and spectating setups where newcomers should watch without interacting.
/gamemode creative @aThe companion command: switches every player currently online, which /defaultgamemode never does.
On a dedicated server the world's default game mode also appears in server.properties as the gamemode key (survival, creative, adventure or spectator). The /defaultgamemode command is the convenient way to change the value while the server is running; editing server.properties and restarting sets the same thing from the configuration side. Keep the two in agreement so a restart does not quietly undo a change you made in-game.
A second key, force-gamemode=true, makes the server put every player into the default game mode on every join, not just their first. That is the blunt instrument for servers where nobody should ever stay in a different mode: combined with the right default, it overrides whatever mode a player had when they last logged out.
In singleplayer the default game mode is chosen on the world creation screen and matters less, since you are the only player and already joined. It still has one practical use there: in a world opened to LAN, friends connecting for the first time receive the default mode, so setting it before they join saves a round of /gamemode commands.
/defaultgamemode sets the game mode that players receive the first time they ever join the world: survival, creative, adventure or spectator. The value is stored with the world itself, so it keeps applying to every future first-time joiner until you change it again. It is most useful on servers and LAN worlds where new people keep arriving.
Because you have already played in that world. /defaultgamemode only applies to players joining for the very first time; everyone else keeps the per-player game mode the world remembers for them. To change yourself or anyone currently playing, use /gamemode instead, for example /gamemode creative or /gamemode survival @a.
/gamemode changes the game mode of specific players immediately and accepts a target, like /gamemode creative Steve or /gamemode survival @a. /defaultgamemode takes no target at all: it changes a world setting that decides what mode brand new players start in. It does nothing to anyone who has already joined.
No. Each player keeps the game mode they last had in that world. After changing the default, run a /gamemode command such as /gamemode adventure @a to bring existing players in line, or set force-gamemode=true in server.properties so the server resets every player to the default mode each time they join.
Yes. The command requires permission level 2, the gamemasters level, the same as most cheat commands. On a server that means an operator account or the server console; in singleplayer or on a LAN world it means cheats have to be enabled. Command blocks can also run it.
Two ways. While the server is running, an operator can run /defaultgamemode with the mode you want. To make the setting part of the server configuration, stop the server and set gamemode=survival, creative, adventure or spectator in server.properties; add force-gamemode=true if every player should be switched to that mode on every join.
Need to switch a specific player instead? Or browse more Minecraft tools: