Minecraft:Commands/gamemode: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{Distinguish|Game mode|Gamemode One}} | {{MC/Distinguish|Game mode|Gamemode One}} | ||
{{Infobox command | {{Infobox command | ||
|name=gamemode | |name=gamemode | ||
| Line 21: | Line 21: | ||
== Arguments == | == Arguments == | ||
{{ | {{MC/El|je|short=1}}: {{MC/Argument|gamemode|gamemode}}<br> | ||
{{ | {{MC/El|be|short=1}}: {{MC/Argument|be=1|gameMode: GameMode|enum}} and {{MC/Argument|be=1|gameMode: int|int}} | ||
: Specifies the new game mode. | : Specifies the new game mode. | ||
:{{ | :{{MC/Arg desc|je=gamemode|be=enum}} | ||
{{ | {{MC/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. | ||
: {{ | : {{MC/Arg desc|je=entity|amount=multiple|type=players|be=player}} | ||
== Result == | == Result == | ||
| Line 42: | Line 42: | ||
== Output == | == Output == | ||
{{Output table}} | {{MC/Output table}} | ||
{{Output table|edition=je|On fail|0|0|0}} | {{MC/Output table|edition=je|On fail|0|0|0}} | ||
{{Output table|On success|1|1|the number of players whose game mode is changed.}} | {{MC/Output table|On success|1|1|the number of players whose game mode is changed.}} | ||
{{Output table|edition=be|On fail|0}} | {{MC/Output table|edition=be|On fail|0}} | ||
{{Output table|On success|the number of targeted players.}} | {{MC/Output table|On success|the number of targeted players.}} | ||
{{Output table}} | {{MC/Output table}} | ||
== Examples == | == Examples == | ||
| Line 62: | Line 62: | ||
=== ''Java Edition'' === | === ''Java Edition'' === | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|java beta}} | |{{MC/HistoryLine|java beta}} | ||
|{{HistoryLine||1.8|dev=Pre-release|Added {{ | |{{HistoryLine||1.8|dev=Pre-release|Added {{MC/Cmd|gamemode <''player''> <''mode''>|link=none}}. The command requires a player and numeric gamemode.}} | ||
|{{HistoryLine|java}} | |{{MC/HistoryLine|java}} | ||
|{{HistoryLine||1.3.1|dev=12w16a|{{ | |{{HistoryLine||1.3.1|dev=12w16a|{{MC/Cmd|gamemode|link=none}} is now usable in singleplayer.|Syntax changed to {{MC/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 {{MC/Cd|adventure}} to {{MC/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.}} | |{{MC/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 {{MC/Cd|spectator}} to {{MC/Cmd|gamemode|link=none}}.}} | ||
|{{HistoryLine||1.9|dev=15w43a|{{ | |{{HistoryLine||1.9|dev=15w43a|{{MC/Cmd|gamemode|link=none}} now displays in the chat the game mode the player switches to.}} | ||
|{{HistoryLine|||dev=16w02a|The {{ | |{{HistoryLine|||dev=16w02a|The {{MC/Cd|m}} selector now accepts the standard literal gamemode values and abbreviations, such as {{MC/Cd|a|d=and|adventure}}, and these may be negated as well (e.g., {{MC/Cd|1=@a[gamemode=!survival]}}).}} | ||
|{{HistoryLine||1.13|dev=17w45a|Removed abbreviated forms and numeric IDs.}} | |{{MC/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.}} | |{{MC/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}} | |{{MC/HistoryLine|pocket alpha}} | ||
|{{HistoryLine||v0.16.0|dev=build 1|Added {{ | |{{HistoryLine||v0.16.0|dev=build 1|Added {{MC/Cmd|gamemode|link=none}}.|Functionality is almost equivalent to Java Edition 1.10 usage, except {{MC/Cmd|gamemode|link=none}} can only use Creative and Survival modes.}} | ||
|{{HistoryLine|pocket}} | |{{MC/HistoryLine|pocket}} | ||
|{{HistoryLine||1.1.0|dev=alpha 1.1.0.0|Added {{ | |{{HistoryLine||1.1.0|dev=alpha 1.1.0.0|Added {{MC/Cd|adventure}} to {{MC/Cmd|gamemode|link=none}}.}} | ||
|{{HistoryLine|bedrock}} | |{{MC/HistoryLine|bedrock}} | ||
|{{HistoryLine||1.18.30|dev=Preview 1.18.30.21|Added {{ | |{{HistoryLine||1.18.30|dev=Preview 1.18.30.21|Added {{MC/Cd|6}} to access Spectator mode.}} | ||
|{{HistoryLine||1.18.31|experiment=Spectator Mode|Added {{ | |{{HistoryLine||1.18.31|experiment=Spectator Mode|Added {{MC/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 {{MC/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.}} | |{{MC/HistoryLine||1.19.50|dev=Preview 1.19.50.20|Spectator mode is no longer locked behind experimental gameplay.}} | ||
}} | }} | ||
== See also == | == See also == | ||
*{{ | *{{MC/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}} | {{MC/Navbox commands}} | ||
de:Befehl/gamemode | de:Befehl/gamemode | ||
Latest revision as of 20:10, 9 April 2026
Template:Hatnote Template:Infobox command
Sets a player's game mode.
Syntax
- Java Edition
gamemode <gamemode> [<target>]
- Bedrock Edition
gamemode <gameMode: GameMode> [player: target]gamemode <gameMode: int> [player: target]
Arguments
- REDIRECT Template:Edition
Template:Rcat: <gamemode>: gamemode
- REDIRECT Template:Edition
Template:Rcat: gameMode: GameMode: enum and gameMode: int: int
- Specifies the new game mode.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|gamemode}}{{#vardefine:be-arg|{{#var:je-arg}}}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
Template:El: <target>: entity
Template:El: player: target: CommandSelector<Player>
- Specifies the target(s). If not specified, defaults to the player who executes the command.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe| Template:IN,}}{{#vardefine:je-arg|entity}}{{#vardefine:be-arg|entity}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
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
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|0}}{{#vardefine:output3-{{#var:output-table-lines}}|0}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|je}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|1}}{{#vardefine:output3-{{#var:output-table-lines}}|the number of players whose game mode is changed.}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|the number of targeted players.}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
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
- REDIRECT Template:Command
Template:RedrTemplate:Only – sets the initial game mode for players joining the world.
External links
de:Befehl/gamemode es:Comandos/gamemode ja:コマンド/gamemode ko:명령어/gamemode pt:Comandos/gamemode ru:Команды консоли/gamemode uk:Команди консолі/gamemode zh:命令/gamemode