Commands/infobox
Sets a player's game mode.
- Syntax
- Java Edition
gamemode <mode> [player]
- Bedrock Edition
gamemode <gameMode: GameMode> [player: target]
- An alternate syntax allows player to enter game mode by its number:
gamemode <gameMode: int> [player: target]
- Arguments
- mode (BE: gameMode: GameMode or gameMode: int)
- Must be one of:
survival
(can be abbreviated ass
or0
[Bedrock Edition only]) for survival modecreative
(can be abbreviated asc
or1
[Bedrock Edition only]) for creative modeadventure
(can be abbreviated asa
or2
[Bedrock Edition only]) for adventure modespectator
for spectator mode[Java Edition only]
- Must be one of:
- "hardcore" is not a valid option for the mode argument, as it is technically not a game mode.
- player (BE: player: target) (optional)
- 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, player is not optional.
- Result
- Fails if the arguments are not specified correctly, or if player fails to resolve to one or more online players.
- If successful, changes the game mode of the default or specified players.
- Examples
- To put yourself into creative mode:
gamemode creative
, orgamemode c
/gamemode 1
[Bedrock Edition only]
- To put all players into survival mode:
gamemode survival @a
- See also
- defaultgamemode – sets the initial game mode for players joining the world