Updated:
The basic form
/gamemode creative
/gamemode survival
/gamemode adventure
/gamemode spectator
Without a target, the command changes your own mode. Add a name or selector to change someone else: /gamemode creative Steve or /gamemode survival @a.
The four modes
| Mode | Write | What it is |
|---|---|---|
| Survival | survival | Health and hunger; gather materials to progress. |
| Creative | creative | Unlimited blocks, flying, no normal damage. |
| Adventure | adventure | Cannot freely break or place blocks; for maps. |
| Spectator | spectator | Fly through blocks and watch; cannot touch anything. |
Java vs Bedrock
Java 1.13 and later accept only the names. /gamemode 1 or /gamemode c are errors; they are Java 1.12 syntax from old tutorials. Bedrock accepts names, numbers (0 survival, 1 creative, 2 adventure) and letters (s, c, a):
/gamemode 1
/gamemode c @p
/gamemode s @a
Those three lines are Bedrock only. Spectator is a newer addition on Bedrock, so older Bedrock versions do not offer it.
Keyboard shortcuts (Java)
Hold F3 and press F4 to open the game mode switcher (1.16+); press F4 again to cycle and release F3 to choose. F3+N toggles between Spectator and your previous mode. Both need cheats or operator permission.
Mode for new players
/defaultgamemode survival
This sets the mode for players joining for the first time; existing players keep theirs. On servers, gamemode and force-gamemode in server.properties also matter.
Adventure maps (Java)
/gamemode adventure @a[gamemode=!creative]
This puts every player except the map makers in Creative into Adventure. To allow breaking specific blocks in Adventure on 1.20.5+, give tools the can_break component.
Common problems
- Numbers on Java: write the name, such as
creative. - Cheats are off: in Java single player, use Open to LAN and allow cheats; on Bedrock, enable cheats in world settings.
- No permission on a server: an admin runs
op YourNamein the console. - @p hits the wrong player from a command block: @p is the player nearest the block; use a name or tag.
- Stuck in Spectator: run
/gamemode survival, or press F3+N on Java.
Check your command
The Command Error Doctor checks common syntax mistakes in your browser.