Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Commands/gamerule: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: updated from Minecraft
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
Line 56: Line 56:
* 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 [[Minecraft:command block]]s from showing what they do: <code>gamerule command_block_output false</code>
* To stop [[Minecraft:command block]]s from showing what they do: <code>gamerule command_block_output false</code>
*To stop [[Minecraft:phantom]]s spawning:<code>gamerule spawn_phantoms false</code>
* To stop [[Minecraft:phantom]]s from spawning:<code>gamerule spawn_phantoms false</code>
* To change [[Minecraft:random tick]] speed (default is 3): <code>gamerule random_tick_speed <speed></code>


== History ==
== History ==

Latest revision as of 11:31, 18 August 2026

Template:Infobox command

Sets or queries a Minecraft: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 Minecraft: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 true or false specified for predefined game rules can affect gameplay, except in the case of maxEntityCramming, randomTickSpeed, spawnRadius, playersSleepingPercentage, functionCommandLimit and maxCommandChainLength where any integer (-2147483648~2147483647) affects gameplay; see Minecraft: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 Minecraft: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 Minecraft:command blocks from showing what they do: gamerule command_block_output false
  • To stop Minecraft:phantoms from spawning:gamerule spawn_phantoms false
  • To change Minecraft:random tick speed (default is 3): gamerule random_tick_speed <speed>

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

See also

External links

Navigation

Template:Navbox commands

Minecraft:de:Befehl/gamerule Minecraft:es:Comandos/gamerule Minecraft:fr:Commandes/gamerule Minecraft:ja:コマンド/gamerule Minecraft:ko:명령어/gamerule Minecraft:pl:Polecenia/gamerule Minecraft:pt:Comandos/gamerule Minecraft:ru:Команды консоли/gamerule Minecraft:uk:Команди консолі/gamerule Minecraft:zh:命令/gamerule