Minecraft:Commands/gamerule: Difference between revisions
From SAS Gaming Wiki
More actions
imported>ProBot m Bot: Adding pl:Polecenia/gamerule |
Remove broken links to missing pages |
||
| Line 4: | Line 4: | ||
* 2 {{only|java|short=1}} | * 2 {{only|java|short=1}} | ||
* 1 {{only|bedrock|short=1}} | * 1 {{only|bedrock|short=1}} | ||
|others= | |others=Cheat only for some rules{{only|bedrock|short=1}} | ||
}} | }} | ||
Sets or queries a | Sets or queries a game rule value. | ||
==Syntax== | ==Syntax== | ||
| Line 26: | Line 26: | ||
{{el|be|short=1}}: {{argument|be=1|rule: BoolGameRule|enum}} and {{argument|be=1|rule: IntGameRule|enum}} | {{el|be|short=1}}: {{argument|be=1|rule: BoolGameRule|enum}} and {{argument|be=1|rule: IntGameRule|enum}} | ||
: Specifies the game rule to set or query. | : Specifies the game rule to set or query. | ||
: Must be one of the predefined game rules; see | : Must be one of the predefined game rules; see Game rule. | ||
{{el|je|short=1}}: {{argument|value}}<br> | {{el|je|short=1}}: {{argument|value}}<br> | ||
{{el|be|short=1}}: {{argument|be=1|value: Boolean|enum}} and {{argument|be=1|value: int|int}} | {{el|be|short=1}}: {{argument|be=1|value: Boolean|enum}} and {{argument|be=1|value: int|int}} | ||
: Specifies the value to set the game rule to. If not specified, queries the value of the game rule instead of setting it. | : Specifies the value to set the game rule to. If not specified, queries the value of the game rule instead of setting it. | ||
: Only <code>true</code> or <code>false</code> specified for predefined game rules can affect gameplay, except in the case of <code>maxEntityCramming</code>, <code>randomTickSpeed</code>, <code>spawnRadius</code>, <code>playersSleepingPercentage</code>, <code>functionCommandLimit</code> and <code>maxCommandChainLength</code> where any integer (-2147483648~2147483647) affects gameplay; see | : Only <code>true</code> or <code>false</code> specified for predefined game rules can affect gameplay, except in the case of <code>maxEntityCramming</code>, <code>randomTickSpeed</code>, <code>spawnRadius</code>, <code>playersSleepingPercentage</code>, <code>functionCommandLimit</code> and <code>maxCommandChainLength</code> where any integer (-2147483648~2147483647) affects gameplay; see Game rule. | ||
==Result== | ==Result== | ||
| Line 49: | Line 49: | ||
==Examples== | ==Examples== | ||
* To stop the | * To stop the day-night cycle: <code>gamerule advance_time false</code> | ||
* To stop natural healing: <code>gamerule natural_health_regeneration false</code> | * To stop natural healing: <code>gamerule natural_health_regeneration false</code> | ||
* To stop creepers, ghasts and other [[Minecraft:mob]]s from modifying blocks: <code>gamerule mob_griefing false</code> | * To stop creepers, ghasts and other [[Minecraft:mob]]s from modifying blocks: <code>gamerule mob_griefing false</code> | ||
* To stop the natural cycle of | * To stop the natural cycle of weather: <code>gamerule advance_weather false</code> | ||
* To make players keep all of their valuables when they die: <code>gamerule keep_inventory true</code> | * To make players keep all of their valuables when they die: <code>gamerule keep_inventory true</code> | ||
* To stop [[Minecraft:TNT]] from exploding: <code>gamerule tnt_explodes false</code> | * To stop [[Minecraft:TNT]] from exploding: <code>gamerule tnt_explodes false</code> | ||
* To stop | * To stop command blocks from showing what they do: <code>gamerule command_block_output false</code> | ||
*To stop | *To stop phantoms spawning:<code>gamerule spawn_phantoms false</code> | ||
== History == | == History == | ||
| Line 86: | Line 86: | ||
{{Navbox commands}} | {{Navbox commands}} | ||
de:Befehl/gamerule | |||
es:Comandos/gamerule | |||
ja:コマンド/gamerule | |||
ko:명령어/gamerule | |||
pl:Polecenia/gamerule | |||
pt:Comandos/gamerule | |||
ru:Команды консоли/gamerule | |||
uk:Команди консолі/gamerule | |||
zh:命令/gamerule | |||
Revision as of 15:44, 9 April 2026
Sets or queries a game rule value.
Syntax
- Java Edition
gamerule <rule name> [<value>]
- Bedrock Edition
gamerule <rule: BoolGameRule> [value: Boolean]gamerule <rule: IntGameRule> [value: int]
Arguments
Arguments Template:In are case sensitive. Arguments Template:In are shown for tab autocompletion as lowercase, but when typed are case-insensitive.
Template:El: Template:Argument
Template:El: Template:Argument and Template:Argument
- Specifies the game rule to set or query.
- Must be one of the predefined game rules; see Game rule.
Template:El: Template:Argument
Template:El: Template:Argument and Template:Argument
- Specifies the value to set the game rule to. If not specified, queries the value of the game rule instead of setting it.
- Only
trueorfalsespecified for predefined game rules can affect gameplay, except in the case ofmaxEntityCramming,randomTickSpeed,spawnRadius,playersSleepingPercentage,functionCommandLimitandmaxCommandChainLengthwhere any integer (-2147483648~2147483647) affects gameplay; see Game rule.
Result
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
Examples
- To stop the day-night cycle:
gamerule advance_time false - To stop natural healing:
gamerule natural_health_regeneration false - To stop creepers, ghasts and other Minecraft:mobs from modifying blocks:
gamerule mob_griefing false - To stop the natural cycle of weather:
gamerule advance_weather false - To make players keep all of their valuables when they die:
gamerule keep_inventory true - To stop Minecraft:TNT from exploding:
gamerule tnt_explodes false - To stop command blocks from showing what they do:
gamerule command_block_output false - To stop phantoms spawning:
gamerule spawn_phantoms false
History
Java Edition
Bedrock Edition
See also
- Template:Cmd – a command Template:In for controlling the spawning of raids, patrols, and wandering traders
External links
de:Befehl/gamerule es:Comandos/gamerule ja:コマンド/gamerule ko:명령어/gamerule pl:Polecenia/gamerule pt:Comandos/gamerule ru:Команды консоли/gamerule uk:Команди консолі/gamerule zh:命令/gamerule