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
- Open Console in the menu on the left.
- Type
gamerule keep_inventory trueand press Enter.
That's it. Players now keep their items when they die.
Popular gamerules
gamerule keep_inventory true: keep your items when you diegamerule players_sleeping_percentage 0: one sleeping player skips the nightgamerule mob_griefing false: creepers don't break blocksgamerule spawn_phantoms false: no phantomsgamerule advance_time false: stop the day and night cyclegamerule 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.