This feature is exclusive to Java Edition.
Sets the default game mode (creative, survival, etc.) for new players entering a multiplayer server.
Syntax
defaultgamemode <mode>
Arguments
<mode>
- Specifies the default game mode for new players. Must be one of the following:
Result
| Command | Trigger | Java Edition |
|---|---|---|
| any | Otherwise | Sets the default game mode. New players who join the world are put into the default game mode. In multiplayer, if force-gamemode in the server.properties file is true, sets all online players to the specified game mode. |
Output
| Command | Edition | Situation | Success Count | /execute store success ... | /execute store result ... |
|---|---|---|---|---|---|
| any | Java Edition | If in multiplayer, and force-gamemode in the server.properties file is true | 1 | 1 | the number of online players whose game mode is changed |
| Otherwise | 1 | 1 | 0 |
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.1 | 12w22a | Added /defaultgamemode. | |||
| 1.8 | 14w05a | Added spectator to /defaultgamemode. | |||