Minecraft:Commands/gamemode: Difference between revisions
More actions
Fix template calls: add MC/ prefix |
Sync: updated from Minecraft |
||
| Line 1: | Line 1: | ||
{{ | {{Distinguish|Game mode|Gamemode One}} | ||
{{Infobox command | {{Infobox command | ||
|name=gamemode | |name=gamemode | ||
| Line 5: | Line 5: | ||
* 2 {{only|java|short=1}} | * 2 {{only|java|short=1}} | ||
* 1 {{only|bedrock|short=1}} | * 1 {{only|bedrock|short=1}} | ||
|others=Cheat only{{only|bedrock|short=1}}<br>No [[Minecraft:Bedrock Editor|editor]]{{only|bedrock|short=1}} | |others=[[Minecraft:Cheat]] only{{only|bedrock|short=1}}<br>No [[Minecraft:Bedrock Editor|editor]]{{only|bedrock|short=1}} | ||
}} | }} | ||
Sets a player's game mode. | Sets a player's [[Minecraft:game mode]]. | ||
== Syntax == | == Syntax == | ||
| Line 21: | Line 21: | ||
== Arguments == | == Arguments == | ||
{{ | {{el|je|short=1}}: {{argument|gamemode|gamemode}}<br> | ||
{{ | {{el|be|short=1}}: {{argument|be=1|gameMode: GameMode|enum}} and {{argument|be=1|gameMode: int|int}} | ||
: Specifies the new game mode. | : Specifies the new game mode. | ||
:{{ | :{{arg desc|je=gamemode|be=enum}} | ||
{{ | {{argument|target|entity|player: target|CommandSelector<Player>}} | ||
: Specifies the target(s). If not specified, defaults to the player who executes the command. | : Specifies the target(s). If not specified, defaults to the player who executes the command. | ||
: {{ | : {{arg desc|je=entity|amount=multiple|type=players|be=player}} | ||
== Result == | == Result == | ||
| Line 42: | Line 42: | ||
== Output == | == Output == | ||
{{ | {{Output table}} | ||
{{ | {{Output table|edition=je|On fail|0|0|0}} | ||
{{ | {{Output table|On success|1|1|the number of players whose game mode is changed.}} | ||
{{ | {{Output table|edition=be|On fail|0}} | ||
{{ | {{Output table|On success|the number of targeted players.}} | ||
{{ | {{Output table}} | ||
== Examples == | == Examples == | ||
| Line 62: | Line 62: | ||
=== ''Java Edition'' === | === ''Java Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{ | |{{HistoryLine|java beta}} | ||
|{{HistoryLine||1.8|dev=Pre-release|Added {{ | |{{HistoryLine||1.8|dev=Pre-release|Added {{cmd|gamemode <''player''> <''mode''>|link=none}}. The command requires a player and numeric gamemode.}} | ||
|{{ | |{{HistoryLine|java}} | ||
|{{HistoryLine||1.3.1|dev=12w16a|{{ | |{{HistoryLine||1.3.1|dev=12w16a|{{cmd|gamemode|link=none}} is now usable in singleplayer.|Syntax changed to {{cmd|gamemode <''mode''> <''player''>|link=none}}, where ''player'' is now optional (defaulting to the sender) and ''mode'' can be a number, or one of <code>survival</code>, <code>creative</code>, <code>s</code>, or <code>c</code>.}} | ||
|{{HistoryLine||1.3.1|dev=12w22a|Added {{ | |{{HistoryLine||1.3.1|dev=12w22a|Added {{cd|adventure}} to {{cmd|gamemode|link=none}}.}} | ||
|{{ | |{{HistoryLine|||dev=12w30a|Invalid numerical game mode IDs are no longer accepted. Previously, specifying an invalid ID would place the target player into Survival mode.}} | ||
|{{HistoryLine||1.8|dev=14w05a|Added {{ | |{{HistoryLine||1.8|dev=14w05a|Added {{cd|spectator}} to {{cmd|gamemode|link=none}}.}} | ||
|{{HistoryLine||1.9|dev=15w43a|{{ | |{{HistoryLine||1.9|dev=15w43a|{{cmd|gamemode|link=none}} now displays in the chat the game mode the player switches to.}} | ||
|{{HistoryLine|||dev=16w02a|The {{ | |{{HistoryLine|||dev=16w02a|The {{cd|m}} selector now accepts the standard literal gamemode values and abbreviations, such as {{cd|a|d=and|adventure}}, and these may be negated as well (e.g., {{cd|1=@a[gamemode=!survival]}}).}} | ||
|{{ | |{{HistoryLine||1.13|dev=17w45a|Removed abbreviated forms and numeric IDs.}} | ||
|{{ | |{{HistoryLine||1.19.3|dev=22w45a|Now this command accepts a [[Minecraft:Argument types|gamemode argument]], instead of literal subcommands.}} | ||
}} | }} | ||
=== ''Bedrock Edition'' === | === ''Bedrock Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{ | |{{HistoryLine|pocket alpha}} | ||
|{{HistoryLine||v0.16.0|dev=build 1|Added {{ | |{{HistoryLine||v0.16.0|dev=build 1|Added {{cmd|gamemode|link=none}}.|Functionality is almost equivalent to [[Minecraft:Java Edition 1.10]] usage, except {{cmd|gamemode|link=none}} can only use Creative and Survival modes.}} | ||
|{{ | |{{HistoryLine|pocket}} | ||
|{{HistoryLine||1.1.0|dev=alpha 1.1.0.0|Added {{ | |{{HistoryLine||1.1.0|dev=alpha 1.1.0.0|Added {{cd|adventure}} to {{cmd|gamemode|link=none}}.}} | ||
|{{ | |{{HistoryLine|bedrock}} | ||
|{{HistoryLine||1.18.30|dev=Preview 1.18.30.21|Added {{ | |{{HistoryLine||1.18.30|dev=Preview 1.18.30.21|Added {{cd|6}} to access Spectator mode.}} | ||
|{{HistoryLine||1.18.31|experiment=Spectator Mode|Added {{ | |{{HistoryLine||1.18.31|experiment=Spectator Mode|Added {{cd|spectator}} to access Spectator mode. | ||
|Spectator mode is now locked behind its own experimental toggle.}} | |Spectator mode is now locked behind its own experimental toggle.}} | ||
|{{HistoryLine||1.19.30|experiment=Spectator Mode|Spectator mode can no longer be accessed via {{ | |{{HistoryLine||1.19.30|experiment=Spectator Mode|Spectator mode can no longer be accessed via {{cd|/gamemode 6}}.|dev=Preview 1.19.30.20}} | ||
|{{ | |{{HistoryLine||1.19.50|dev=Preview 1.19.50.20|Spectator mode is no longer locked behind experimental gameplay.}} | ||
}} | }} | ||
== See also == | == See also == | ||
*{{ | *{{cmd|defaultgamemode}}{{only|java}} – sets the initial game mode for players joining the world. | ||
== External links == | == External links == | ||
| Line 98: | Line 98: | ||
== Navigation == | == Navigation == | ||
{{ | {{Navbox commands}} | ||
de:Befehl/gamemode | [[Minecraft:de:Befehl/gamemode]] | ||
es:Comandos/gamemode | [[Minecraft:fr:Commandes/gamemode]] | ||
ja:コマンド/gamemode | [[Minecraft:es:Comandos/gamemode]] | ||
ko:명령어/gamemode | [[Minecraft:ja:コマンド/gamemode]] | ||
pt:Comandos/gamemode | [[Minecraft:ko:명령어/gamemode]] | ||
ru:Команды консоли/gamemode | [[Minecraft:pt:Comandos/gamemode]] | ||
uk:Команди консолі/gamemode | [[Minecraft:ru:Команды консоли/gamemode]] | ||
zh:命令/gamemode | [[Minecraft:uk:Команди консолі/gamemode]] | ||
[[Minecraft:zh:命令/gamemode]] | |||
Latest revision as of 11:11, 11 April 2026
Template:Distinguish Template:Infobox command
Sets a player's Minecraft:game mode.
Syntax
- Java Edition
gamemode <gamemode> [<target>]
- Bedrock Edition
gamemode <gameMode: GameMode> [player: target]gamemode <gameMode: int> [player: target]
Arguments
Template:El: Template:Argument
Template:El: Template:Argument and Template:Argument
- Specifies the new game mode.
- Template:Arg desc
- Specifies the target(s). If not specified, defaults to the player who executes the command.
- Template:Arg desc
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table Template:Output table
Examples
- To put the executing player into Creative mode:
/gamemode creative/gamemode cTemplate:Only/gamemode 1Template:Only
- To put all players into Survival mode:
/gamemode survival @a
History
Java Edition
Bedrock Edition
See also
- Template:CmdTemplate:Only – sets the initial game mode for players joining the world.
External links
Minecraft:de:Befehl/gamemode Minecraft:fr:Commandes/gamemode Minecraft:es:Comandos/gamemode Minecraft:ja:コマンド/gamemode Minecraft:ko:명령어/gamemode Minecraft:pt:Comandos/gamemode Minecraft:ru:Команды консоли/gamemode Minecraft:uk:Команди консолі/gamemode Minecraft:zh:命令/gamemode