News
Game
Guides
Downloads
Versions
/gamemode
COMMANDS PLAYERS & MOVEMENT CHEATS · LEVEL 2 Added in 1.14 or earlier

/gamemode command in Minecraft

/gamemode switches a player between Survival, Creative, Adventure and Spectator. Without a target it changes your own mode. It is the quickest way to fly around a build, test a map in Adventure or follow a game as a spectator.

Syntax

/gamemode <gamemode> [<target>]
ArgumentExpectsWhat it does
gamemodeGame modeThe new mode, written in full: survival, creative, adventure or spectator.
targetoptionalPlayer selectorone or severalPlayers to change: a name, @a, @p or a filtered selector. Without it, the command changes your own mode.
All 2 forms
  • /gamemode <gamemode>
  • /gamemode <gamemode> <target>

Examples

Switch yourself to Creative

/gamemode creative

Puts you in Creative Mode to fly and build freely.

Java 26.3

Everyone back to Survival

/gamemode survival @a

Sets every online player to Survival Mode, for example at the start of a game.

Java 26.3

Adventure mode near a map

/gamemode adventure @a[distance=..20]

Players within 20 blocks switch to Adventure Mode and can no longer break blocks freely.

Java 26.3

Make one player a spectator

/gamemode spectator Steve

Steve switches to Spectator Mode and can watch the game without interfering.

Java 26.3
Interactive tool

Command generator

Fill in the fields, copy the command, paste it in the chat. Syntax checked against Java Edition 26.3.

Turn on JavaScript to use the interactive version.

/gamemode creative @p

Calculated from the Java Edition 26.3 game files

Turning on cheats

/gamemode needs permission level 2. In singleplayer, enable "Allow Commands" when you create the world. For an existing world, choose "Open to LAN" and turn on "Allow Cheats": it lasts until you close the world. On a server, you have to be an operator.

The four modes

  • survival: health, hunger and mining as usual.
  • creative: unlimited blocks, flying and instant mining.
  • adventure: blocks can only be broken or placed with items carrying the can_break or can_place_on component, ideal for maps.
  • spectator: you fly through blocks, cannot interact, and can view through a mob's eyes with /spectate.

Good to know

Write the full mode name: numbers such as 1 or letters such as c no longer work in Java Edition and return "Unknown game mode: 1". Hardcore is not a game mode for this command: it is chosen when the world is created. The mode given to new players is set with /defaultgamemode. To hand out building blocks in Survival instead, use /give.

✓ Checked in Java Edition 26.3 · updated 2 November 2026

/gamemode: FAQ

Can I switch to Hardcore with /gamemode?

No. Hardcore is a world setting chosen at creation, not one of the four modes the command accepts.

Why does /gamemode 1 not work?

Java Edition only accepts the full names: survival, creative, adventure and spectator. Numbers and single letters return an unknown game mode error.

How do I use /gamemode?

Type it in the chat with cheats on: /gamemode <gamemode> [<target>].

Who can use /gamemode?

Cheats on, or operator level 2.

Related commands