Gamerules

Gamerules let you customize how your Minecraft world works. You can use them to change gameplay mechanics without installing mods or plugins. For example, you can make players keep their items after death, stop creepers from destroying blocks, or freeze the day-night cycle.

Useful gamerules 

Gamerules are often applicable to both available Minecraft Editions: Bedrock and Java. Here is a list of the most common gamerules and their functions. 

Before Minecraft: Java Edition 1.21.11

Before Minecraft: Java Edition version 1.21.11, gamerules were written identically in both Java and Bedrock Editions.

Gamerule What it does Default Java Bedrock
keepInventory Players keep items and XP when they die false
mobGriefing Allows mobs to break or change blocks true
doFireTick Fire spreads to nearby blocks true
doDaylightCycle Time passes naturally true
doMobSpawning Mobs spawn naturally in the world true

Minecraft: Java Edition 1.21.11 and later

With the release of Minecraft Java Edition 1.21.11 (Snapshot 25w44a), all gamerule names have been changed to use snake_case with an optional minecraft: prefix. Here is the updated list of the most common gamerules with their new names.

Gamerule What it does Default Java Bedrock
keep_inventory Players keep items and XP when they die false
mob_griefing Allows mobs to break or change blocks true
fire_spread_radius_around_player Maximum distance fire can spread around a player (0 = disabled, -1 = unlimited) 128
advance_time Time passes naturally true
spawn_mobs Mobs spawn naturally in the world true

This is just a small list of gamerules. You can find a complete list of all gamerules here.

Adjust gamerules directly on exaroton

The easiest way to use gamerules is by utilizing the built-in gamerule list on the exaroton panel. Simply click the options button for the specific Minecraft world on our Worlds page, find the desired gamerule, and apply it with just a few clicks. With this link, you can access the options directly. The options will be saved directly in the level.dat file.

The gamerule command

Besides the recommended method through our panel, you can also use the gamerule command directly in the Minecraft chat or console to adjust the specific gamerule. Here's an example of the syntax.

/gamerule <rule> <value>

<rule>   the name of the gamerule you want to change

<value>  the value you want to set it to
Please note that the game rules are case-sensitive, so you must write them exactly as they are documented.

This example will enable the keepInventory gamerule:

/gamerule keepInventory true
[Server thread/INFO]: Gamerule keepInventory is now set to: true

Paper/Bukkit/Spigot

In Bukkit based servers, gamerules are set per dimension rather than globally. The /gamerule command will only update gamerules for the dimension you are currently standing in.

Other dimensions

If you want to change a gamerule in a specific dimension, you can click the options button for the desired dimension on the Worlds page, or you can use the /execute  command.

/execute in <dimension> run gamerule <rule> <value>

<dimension>  the dimension you want to target
             (minecraft:overworld, minecraft:the_end, or minecraft:the_nether)

<rule>       the name of the gamerule you want to change

<value>      the value you want to set it to