Sets a player's game mode.
- Java Edition
gamemode [adventure|creative|spectator|survival] [<target>]
- Bedrock Edition
gamemode <gameMode: GameMode> [player: target]
- An alternate syntax allows player to enter game mode by its number:
gamemode <gameMode: int> [player: target]
gameMode: GameMode or
- Must be one of:
- "hardcore" is not a valid option for the mode argument, as it is technically not a game mode.
- If specified, must be either a player's username or a target selector. If unspecified, defaults to the player using the command. When used in a command block, it is not optional.
- Entities other than players are not allowed.
Fails if the arguments are not specified correctly, or if
<target> fails to resolve to one or more online players.
On success, changes the game mode of the default or specified players.
- 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 22.214.171.124||Added |