/gamemode Command in Minecraft Java Edition

Change Player Game Modes in Minecraft

Java EditionPlayers & EntitiesPermission: Level 2Bedrock version →

The /gamemode command changes the active game mode for you or other players on a server. You can switch between survival, creative, adventure, and spectator at any time.

Players and server operators use this command to test builds, explore worlds without taking damage, or set up custom map rules for visitors. You need permission level 2 (cheats enabled in single-player or operator status on a server) to run it.

Syntax (Java 26.3, 1 form)

  1. /gamemode <gamemode> [<target>]

The forms you will use most

/gamemode <gamemode> [<target>]
Sets the specified game mode for yourself or for the chosen target player(s).

Arguments

ArgumentTypeWhat it means
<gamemode>game modeThe game mode to apply, which must be survival, creative, adventure, or spectator.
<target>target selector
players only
An optional player name, UUID, or player-only target selector (such as @p, @a, or @s) identifying who gets the new game mode.

Examples

Version history

Measured from the game files of every Java release from 1.13 to 26.3.

  1. 1.19.3 Syntax changed.
    + /gamemode <gamemode> [<target>]− /gamemode adventure [<target>]− /gamemode creative [<target>]− /gamemode spectator [<target>]− /gamemode survival [<target>]
  2. 1.13 Already in the game in 1.13, the oldest Java version we track.

Tips

Common mistakes

Java vs Bedrock

Bedrock Edition also includes the /gamemode command, but its syntax allows either a game mode name or an integer number: /gamemode <gameMode: GameMode> [player: target] or /gamemode <gameMode: int> [player: target].

See /gamemode in Bedrock Edition →

FAQ

What game modes can I use with /gamemode?

In Minecraft Java Edition, the four valid options for the <gamemode> argument are survival, creative, adventure, and spectator.

Why does the /gamemode command say I do not have permission?

The /gamemode command requires permission level 2, which means you must be a server operator or have cheats enabled in your single-player world.

Can I change the game mode of mobs or other entities?

No, the <target> argument only accepts players, so non-player entities cannot have a game mode.

Related commands

/advancement/attribute/damage/defaultgamemode/effect/experience/kill/ride/rotate/spawnpoint/spectate/spreadplayers/summon/swing/teleport/tp

More on 9Minecraft