Try our affiliated browser extension - redirect to BreezeWiki automatically!

Commands/defaultgamemode

This feature is exclusive to Java Edition. 

Sets the default game mode (Creative, Survival, etc.) for new players entering a multiplayer server. If in multiplayer and force-gamemode in the server.properties file is true, or if in LAN world, all online players are set to this game mode.

Syntax

defaultgamemode <gamemode>

Arguments

<gamemode>: gamemode

Specifies the default game mode.
Must be one of the following:Note that "hardcore" is not a valid option, as it is technically not a game mode.

Result

CommandTriggerJava Edition
anythe arguments are not specified correctly Unparseable
OtherwiseSuccessful

Output

CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionIf in multiplayer, and force-gamemode in the server.properties file is true11the number of online players whose game mode is changed
Otherwise110

Examples

  • To set the default game mode to survival: defaultgamemode survival

See also

/gamemode – changes a player's game mode

History

Java Edition
1.3.112w22aAdded /defaultgamemode.
1.814w05aAdded spectator to /defaultgamemode.
1.19.322w45aNow this command accepts a gamemode argument, instead of literal subcommands.