/defaultgamemode

From Minecraft Wiki
Jump to navigation Jump to search
This feature is exclusive to Java Edition.
 
/defaultgamemode
Permission level
required

2

Restrictions

None

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

[edit | edit source]
defaultgamemode <gamemode>

Arguments

[edit | edit source]

<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

[edit | edit source]

CommandTriggerJava Edition
AnyThe command is incomplete, or any argument is not specified correctly. Unparseable
OtherwiseSuccessful

Output

[edit | edit source]

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
Java EditionIf in LAN world11the number of online players whose game mode is changed
Otherwise110

Examples

[edit | edit source]
  • To set the default game mode to survival: defaultgamemode survival

See also

[edit | edit source]
/gamemode – changes a player's game mode

History

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