Sets a player's game mode.
- Java Edition
gamemode (adventure|creative|spectator|survival) [<target>]
- Bedrock Edition
gamemode <gameMode: GameMode> [player: target]
gamemode <gameMode: int> [player: target]
- Specifies the new game mode. Must be one of the following:
- "hardcore" is not a valid option for the
<mode>argument, as it is technically not a game mode.
- Must be a player name, a target selector or a UUID[Java Edition only]. And the target selector must be of player type.
- Specifies the target(s). If not specified, defaults to the player who executes the command.
|Command||Trigger||Java Edition||Bedrock Edition|
|any||the arguments are not specified correctly||Unparseable||Failed|
|if all the players are already in the specified game mode||Successful|
|On success||Sets the game mode of the specified players|
|any||Java Edition||On fail||0||0||0|
|On success||1||1||the number of players whose game mode is changed.|
|Bedrock Edition||On fail||0||N/A||N/A|
|On success||the number of targeted players.||N/A||N/A|
- To put the executing player into creative mode:
- To put all players into survival mode
gamemode survival @a
/defaultgamemode– sets the initial game mode for players joining the world.
|Java Edition Beta|
|Syntax changed to |
|12w30a||Changed the ID for survival mode from |
|1.13||17w45a||Removed abbreviated forms and numeric IDs.|
|Pocket Edition Alpha|
|0.16.0||build 1||Added |
|Functionality is almost equivalent to Java Edition 1.10 usage, except |
|1.1.0||alpha 220.127.116.11||Added |