Switch yourself to Creative
/gamemode creativePuts you in Creative Mode to fly and build freely.

/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.
/gamemode <gamemode> [<target>]| Argument | Expects | What it does |
|---|---|---|
| gamemode | Game mode | The new mode, written in full: survival, creative, adventure or spectator. |
| targetoptional | Player selectorone or several | Players to change: a name, @a, @p or a filtered selector. Without it, the command changes your own mode. |
/gamemode creativePuts you in Creative Mode to fly and build freely.
/gamemode survival @aSets every online player to Survival Mode, for example at the start of a game.
/gamemode adventure @a[distance=..20]Players within 20 blocks switch to Adventure Mode and can no longer break blocks freely.
/gamemode spectator SteveSteve switches to Spectator Mode and can watch the game without interfering.
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 @pCalculated from the Java Edition 26.3 game files
/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.
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.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
No. Hardcore is a world setting chosen at creation, not one of the four modes the command accepts.
Java Edition only accepts the full names: survival, creative, adventure and spectator. Numbers and single letters return an unknown game mode error.
Type it in the chat with cheats on: /gamemode <gamemode> [<target>].
Cheats on, or operator level 2.