Updated:
How to write it
| Version | Keep 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 does | Java 1.21.11+ | Java 1.21.10 and earlier | Bedrock |
|---|---|---|---|
| Keep items on death | keep_inventory | keepInventory | keepinventory |
| Stop mobs (creepers etc.) breaking blocks | mob_griefing | mobGriefing | mobgriefing |
| Stop the day/night cycle | advance_time | doDaylightCycle | dodaylightcycle |
| Stop the weather changing | advance_weather | doWeatherCycle | doweathercycle |
| Stop natural mob spawning | spawn_mobs | doMobSpawning | domobspawning |
| Stop phantoms | spawn_phantoms | doInsomnia | doinsomnia |
| Turn off natural health regeneration | natural_health_regeneration | naturalRegeneration | naturalregeneration |
| Turn off fall damage | fall_damage | fallDamage | falldamage |
| Hide death messages | show_death_messages | showDeathMessages | showdeathmessages |
| Change the share of players who must sleep | players_sleeping_percentage | playersSleepingPercentage | playerssleepingpercentage |
| Respawn without the death screen | immediate_respawn | doImmediateRespawn | doimmediaterespawn |
| Hide command block output in chat | command_block_output | commandBlockOutput | commandblockoutput |
| Hide command feedback | send_command_feedback | sendCommandFeedback | sendcommandfeedback |
| Change crop and plant growth speed | random_tick_speed | randomTickSpeed | randomtickspeed |
| Spread of the world spawn point | respawn_radius | spawnRadius | spawnradius |
| Blocks drop no items | block_drops | doTileDrops | dotiledrops |
| Mobs drop no loot | mob_drops | doMobLoot | domobloot |
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+) | Default | Example |
|---|---|---|
players_sleeping_percentage | 100 | 0 lets one sleeping player skip the night |
random_tick_speed | 3 (Bedrock: 1) | Higher values grow crops faster; very high values cause lag |
respawn_radius | 10 | 0 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
/gamerule showcoordinates trueshows your coordinates on screen./gamerule tntexplodes falsestops TNT from exploding.
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
- "Unknown game rule": the name does not match your version. Old camelCase names do not work on 1.21.11 and later.
- The setting does not apply: game rules are saved per world. Make sure you changed the world you are playing.
- Raids started after setting raids to true: on 1.21.11 and later, true means raids are on.
- Error on Bedrock: remove capital letters and underscores.
Check your command
The Command Error Doctor flags old camelCase game rule names on 1.21.11 and later and shows the new name.