Switch your own mode or change a friend's
Change from Survival to Creative to test a build, then switch back without losing your gear or XP levels.
- Pick Java Edition or Bedrock at the top of the tool so the syntax matches your game.
- Select Survival, Creative, Adventure or Spectator. On Bedrock, you can also pick Default to return a player to the world's starting mode.
- Leave Target (Optional) blank to change your own mode. To change someone else, type their player name or pick a selector button (
@s,@p,@aor@r). - Press Copy command, open Minecraft chat and paste the line to run it.
Your items and experience stay intact when you move between Survival, Creative and Adventure. Switching to Spectator hides your hotbar while you pass through blocks, and your items reappear as soon as you switch back.
Match Java and Bedrock rules
Java Edition from 1.13 onward requires the full mode word, such as /gamemode creative. Old shortcuts like /gamemode 1 or /gamemode c return an error in modern Java worlds.
Bedrock Edition accepts full names, numbers (0, 1, 2) and one-letter shortcuts. Turn on Use short form in Bedrock mode to output s, c, a or d instead of the full word. Both editions write spectator in full.
Before running the command, make sure your world allows it:
- Java singleplayer: enable cheats when creating the world, or use Open to LAN with commands enabled.
- Java servers: your account needs operator permission level 2 or higher.
- Bedrock worlds: turn on Activate Cheats in your world settings.
Run gamemode switches in command blocks and maps
Use target selectors when a pressure plate or command block should change whoever triggers it. Pick @p to switch the nearest player, such as someone stepping onto an Adventure map lobby pad. Pick @r to send one random player into Spectator for a minigame.
Double-check before running @a on a busy server, since it updates every online player at once. On Java Edition, you can also switch your own mode quickly without opening chat by holding F3, tapping F4 until the mode you want is highlighted, and releasing F3. On Java Edition you can also make new players joining the world start in a different mode by running /defaultgamemode followed by the mode name. Bedrock Edition has no such command, so change the default in the world settings instead.