Hello there! We are conducting a survey to better understand the user experience in making a first edit. If you have ever made an edit on Gamepedia, please fill out the survey. Thank you!

Commands/gamemode

From Minecraft Wiki
Jump to: navigation, search

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:
"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, or gamemode c/gamemode 1[Bedrock Edition only]
To put all players into survival mode: gamemode survival @a

See also[edit]

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

History[edit]

Java Edition
1.3.112w16aAdded /gamemode.
12w30a/gamemode 3 changed to /gamemode 0 (survival mode).
1.814w05aAdded spectator to /gamemode.
1.915w43a/gamemode now displays in the chat the gamemode the player switches to.
16w02a The m selector now accepts the standard literal gamemode values and abbreviations, such as a and adventure, and these may be negated as well.
Pocket Edition Alpha
0.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 1.1.0.0Added adventure to /gamemode.