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 |
| Stop wardens spawning | spawn_wardens | doWardenSpawning | none |
| Stop pillager patrols | spawn_patrols | doPatrolSpawning | none |
| Stop wandering traders | spawn_wandering_traders | doTraderSpawning | none |
| Hide advancement messages | show_advancement_messages | announceAdvancements | none |
| Stop TNT exploding | tnt_explodes | tntExplodes (1.21.2+) | tntexplodes |
| Block limit for fill and clone | max_block_modifications | commandModificationBlockLimit (1.20.3+) | none |
| Players can hurt each other (set false to stop) | pvp | pvp (1.21.9+) | pvp |
| Monsters spawn naturally | spawn_monsters | spawnMonsters (1.21.9+) | none |
| Nether portals work | allow_entering_nether_using_portals | allowEnteringNetherUsingPortals (1.21.9+) | none |
| Stop fire spreading (set to 0) | fire_spread_radius_around_player | doFireTick (set false) | dofiretick |
| Locator bar shows | locator_bar | locatorBar (1.21.6+) | none |
| Command blocks work | command_blocks_work | commandBlocksEnabled (1.21.9+) | commandblocksenabled |
To disable raids, use /gamerule minecraft:raids false in 1.21.11+ or /gamerule disableRaids true in 1.21.10 and earlier. The new rule flips the meaning of true and false.
The pvp, monster, Nether portal and command block rows replaced the server.properties keys pvp, spawn-monsters, allow-nether and enable-command-block in Java 1.21.9. Older servers still set them in server.properties.
To hide only some players from the locator bar, see locator bar commands.
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.
Other Bedrock rules
/gamerule showcoordinates trueshows your coordinates on screen./gamerule tntexplodes falsestops TNT from exploding. Java has the same rule astnt_explodes(1.21.11+) ortntExplodes(1.21.2 to 1.21.10).
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.