Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Commands and cheats/gamemode

Switch game

23 Wikis · pick your game
/gamemode

Command

/gamemode

Changes the game mode of players.

Syntax

/gamemode <gamemode> [<target>]

Arguments

ArgumentKind of valueWhat to type
<gamemode>Game modeThe game mode: survival, creative, adventure or spectator.
<target>Target selectorThe players whose game mode is changed. Defaults to yourself. One or more players.

Details

Permission level2: operators, worlds with cheats on, command blocks and functions
Works inOperators on multiplayer servers, singleplayer worlds with cheats enabled, and command blocks and functions.
ResultReports "Set own game mode to ..." or "Set <player>'s game mode to ...". The number /execute store saves is the number of players whose game mode changed.
No targetWithout a target the command changes your own game mode. It then has to be run by a player, so a command block or the server console must name a target.
Already in that modePlayers who are already in the chosen game mode are skipped without a message and are not counted.
Message to the playerA player whose game mode is changed by someone else is told about it, unless the game rule send_command_feedback is off.

Examples

/gamemode creative

Puts you in Creative mode.

/gamemode survival

Puts you in Survival mode.

/gamemode spectator @s

Puts you in Spectator mode.

/gamemode adventure @a

Puts every player in Adventure mode.

/gamemode survival @p

Puts the nearest player in Survival mode.

Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)