Minecraft Wiki
Permission level

2‌[JE only]
1‌[BE only]


Cheat only‌[BE only]

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]


JE: adventure|creative|spectator|survival
BE: gameMode: GameMode: enum and gameMode: int: int

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.

JE<target>: entity
BE: player: target: CommandSelector<Player>

Specifies the target(s). If not specified, defaults to the player who executes the command.
Must be a player name, a target selector or a UUID[Java Edition only]. And the target selector must‌[JE only]/should‌[BE only] be of player type.


CommandTriggerJava EditionBedrock Edition
anythe arguments are not specified correctly Unparseable Unparseable
gameMode: int is not a valid game mode id. N/A Failed
player: target is not in player type
<target> or player: target fails to resolve to one or more online players Failed
<target> or player: target is not specified when the command's executor is not a player
On successSets the game mode of the specified players


CommandEditionSituationSuccess Count/execute store success .../execute store result ...
anyJava EditionOn fail000
On success11the number of players whose game mode is changed.
Bedrock EditionOn fail0N/AN/A
On successthe number of targeted players.N/AN/A


  • To put all players into survival mode:
    gamemode survival @a

See also[]

  • /defaultgamemode – sets the initial game mode for players joining the world.


Java Edition Beta
1.8Pre-releaseAdded /gamemode <player> <mode>. The command requires a player and numeric gamemode.
Java Edition
1.3.112w16a/gamemode is now usable in singleplayer.
Syntax changed to /gamemode <mode> <player>, where player is now optional (defaulting to the sender) and mode can be a number, or one of survival, creative, s, or c.
12w30aChanged the ID for survival mode from 3 to 0, changing /gamemode 3 to /gamemode 0.
1.814w05aAdded spectator to /gamemode.
1.915w43a/gamemode now displays in the chat the gamemode the player switches to.
16w02aThe m selector now accepts the standard literal gamemode values and abbreviations, such as a, and adventure, and these may be negated as well (e.g., @a[gamemode=!survival]).
1.1317w45aRemoved abbreviated forms and numeric IDs.
Pocket Edition Alpha
v0.16.0build 1Added /gamemode.
Functionality is almost equivalent to Java Edition 1.10 usage, except /gamemode can only use Creative and Survival modes.
Pocket Edition
1.1.0alpha adventure to /gamemode.
Bedrock Edition
1.18.30beta 6 to access spectator mode.
1.18.31Added spectator to access spectator mode.