/gamemode Command
Sets the game mode of one or more players. Accepted values are survival, creative, adventure, and spectator. If no target is specified, applies to the command executor.
Syntax
/gamemode <gamemode> [<target>]Permission: OP level 2Edition: Both
Examples
/gamemode creative/gamemode survival @a/gamemode spectator PlayerName/gamemode adventure @pNotes
Numeric and abbreviated game mode IDs (e.g. 'c' for creative) were removed in Java 1.13; use full names only. Hardcore is not a valid /gamemode value — it is a world-level setting. Target must resolve to player-type entities.