Keep your items after death
/gamerule keep_inventory trueYour inventory and experience stay with you when you die.

Game rules change how a world behaves, from what you keep after death to how many players must sleep to skip the night. These are the rules most worth changing in survival or on a server, with values the game accepts.
/gamerule keep_inventory trueYour inventory and experience stay with you when you die.
/gamerule mob_griefing falseMobs can no longer destroy blocks; endermen stop moving them too.
/gamerule players_sleeping_percentage 50Half of the online players in bed is enough to skip to morning.
/gamerule spawn_phantoms falsePhantoms no longer spawn, even if you have not slept for days.
/gamerule immediate_respawn trueSkips the death screen and puts you straight back at your spawn point.
/gamerule pvp falsePlayers can no longer hurt each other, ideal for a peaceful server.
/gamerule locator_bar falseRemoves the bar that shows where other players are.
/gamerule raids falseBad Omen no longer starts a raid when you enter a village.
/gamerule random_tick_speed 6Doubles random ticks: crops, saplings and grass grow faster.
/gamerule fire_spread_radius_around_player 0Fire no longer spreads to nearby blocks, a safety net for wooden builds.
/gamerule spectators_generate_chunks falsePlayers in Spectator mode no longer generate new terrain.
/gamerule natural_health_regeneration falseHealth no longer regenerates from a full food bar; potions and golden apples still heal.
Type /gamerule followed by the rule and a value, as in the list. Without a value, the game tells you the current setting: Game rule keep_inventory is currently set to false. Rules belong to the world, so on a server one change applies to every player. You need cheats on or operator level 2.
Rule names now use lowercase words joined by underscores. The old forms like keepInventory are no longer accepted and give an error. Booleans only take true or false. Want to remove phantoms without a rule? Sleeping regularly does the job too; see the Phantom page.
✓ Checked in Java Edition 26.3 · updated 2 November 2026
No. Each world keeps its own rules. Set them again in every world, or pick them in the Game Rules screen when you create a new one.
Type /gamerule followed by the rule name only, for example /gamerule keep_inventory. The game replies with the current value.
/gameruleRead or change the game rules of a world