Updated:

How to write it

VersionKeep items on death
Java 1.21.11 and later/gamerule minecraft:keep_inventory true
Java 1.21.10 and earlier/gamerule keepInventory true
Bedrock Edition/gamerule keepinventory true

On 1.21.11 and later the minecraft: prefix is optional, so /gamerule keep_inventory true also works. Bedrock names are all lowercase with no underscores.

Common game rules

What it doesJava 1.21.11+Java 1.21.10 and earlierBedrock
Keep items on deathkeep_inventorykeepInventorykeepinventory
Stop mobs (creepers etc.) breaking blocksmob_griefingmobGriefingmobgriefing
Stop the day/night cycleadvance_timedoDaylightCycledodaylightcycle
Stop the weather changingadvance_weatherdoWeatherCycledoweathercycle
Stop natural mob spawningspawn_mobsdoMobSpawningdomobspawning
Stop phantomsspawn_phantomsdoInsomniadoinsomnia
Turn off natural health regenerationnatural_health_regenerationnaturalRegenerationnaturalregeneration
Turn off fall damagefall_damagefallDamagefalldamage
Hide death messagesshow_death_messagesshowDeathMessagesshowdeathmessages
Change the share of players who must sleepplayers_sleeping_percentageplayersSleepingPercentageplayerssleepingpercentage
Respawn without the death screenimmediate_respawndoImmediateRespawndoimmediaterespawn
Hide command block output in chatcommand_block_outputcommandBlockOutputcommandblockoutput
Hide command feedbacksend_command_feedbacksendCommandFeedbacksendcommandfeedback
Change crop and plant growth speedrandom_tick_speedrandomTickSpeedrandomtickspeed
Spread of the world spawn pointrespawn_radiusspawnRadiusspawnradius
Blocks drop no itemsblock_dropsdoTileDropsdotiledrops
Mobs drop no lootmob_dropsdoMobLootdomobloot

Most rules take true or false. To turn something off, set it to false, for example /gamerule minecraft:mob_griefing false.

Rules that take a number

Rule (1.21.11+)DefaultExample
players_sleeping_percentage1000 lets one sleeping player skip the night
random_tick_speed3 (Bedrock: 1)Higher values grow crops faster; very high values cause lag
respawn_radius100 makes everyone start at the exact same spot

Rules whose meaning was inverted

disableRaids became raids in 1.21.11, and true and false swapped meaning. To stop raids, older versions use /gamerule disableRaids true; 1.21.11 and later use /gamerule minecraft:raids false. In the same way disableElytraMovementCheck became elytra_movement_check and disablePlayerMovementCheck became player_movement_check, both with inverted values.

Bedrock-only rules

Check the current value

Run the rule without a value, such as /gamerule minecraft:keep_inventory, to print the current setting. Typing /gamerule and waiting a moment shows every rule your version supports, which is the safest way to find the right name.

Common problems

Check your command

The Command Error Doctor flags old camelCase game rule names on 1.21.11 and later and shows the new name.