Keep inventory and other gamerules

Keep inventory and other gamerules

Server settings · Updated 27 October 2026

Gamerules change how your world plays, like keeping your items when you die. You set them with a command in the console.

Turn on keep inventory

  1. Open Console in the menu on the left.
  2. Type gamerule keep_inventory true and press Enter.

That's it. Players now keep their items when they die.

Popular gamerules

  • gamerule keep_inventory true: keep your items when you die
  • gamerule players_sleeping_percentage 0: one sleeping player skips the night
  • gamerule mob_griefing false: creepers don't break blocks
  • gamerule spawn_phantoms false: no phantoms
  • gamerule advance_time false: stop the day and night cycle
  • gamerule pvp false: turn off player vs player

Older Minecraft versions

On Minecraft 1.21.10 and older, gamerule names are written as one word, for example keepInventory, playersSleepingPercentage, mobGriefing, doInsomnia (phantoms) and doDaylightCycle. To turn off PvP on these versions, set pvp to off in Properties instead.

Good to know

  • Gamerules save with your world, so they stay on after a restart.
  • Operators can also type gamerules in game chat, with a / in front. See Make a player an operator.