Black Friday: first month free on quarterly plans · until 30 Nov See the plans Conditions
New here? Try a Minecraft server or Discord bot free for 24 hours. Try free
ServerSparkServerSpark

Knowledge base

Minecraft game rules explained: keepInventory and more (2026)

The game rules people change most (keep inventory, mob griefing, one player sleeping, PvP) with the new 1.21.11+ names, the old names and the Bedrock names.

NVMe nodesNightly backupsOnline in minutes

Updated 4 November 2026

To keep your items when you die on a Minecraft Java server, type gamerule keep_inventory true in the console (Minecraft 1.21.11 and newer) or gamerule keepInventory true on older versions. Game rules are changed with a command, not in server.properties, and they take effect straight away without a restart.

Game rule names were checked on 29 October 2026 against the Minecraft Wiki's game rule reference. In Java snapshot 25w44a (part of 1.21.11) Mojang renamed all game rules to lowercase names with underscores, so guides written before that use the old names.

How to change a game rule

  1. Open your server in SparkPanel and go to the console.
  2. Type the rule without a slash, for example gamerule keep_inventory true, and press Enter. In the game itself, as an operator, type the same with a slash: /gamerule keep_inventory true.
  3. To see the current value, type the rule without a value: gamerule keep_inventory.
Not sure of a name? Type /gamerule in the game chat and press Tab: Minecraft lists every rule your version knows.

The rules people change most

What you wantJava 1.21.11 and newerJava before 1.21.11Bedrock
Keep items and XP on deathkeep_inventory truekeepInventory truekeepinventory true
Creepers and endermen don't break blocksmob_griefing falsemobGriefing falsemobgriefing false
One sleeping player skips the nightplayers_sleeping_percentage 0playersSleepingPercentage 0playerssleepingpercentage 0
Always day (stop the clock)advance_time falsedoDaylightCycle falsedodaylightcycle false
No rain or thunder changesadvance_weather falsedoWeatherCycle falsedoweathercycle false
No attacking each otherpvp false (1.21.9+)pvp=false in server.propertiespvp false
No phantomsspawn_phantoms falsedoInsomnia falsedoinsomnia false
Skip the death screenimmediate_respawn truedoImmediateRespawn truedoimmediaterespawn true
Hide death messages in chatshow_death_messages falseshowDeathMessages falseshowdeathmessages false
Hide advancement messagesshow_advancement_messages falseannounceAdvancements false(not on Bedrock)

Bedrock rule names are not case-sensitive. The percentage rule means the share of online players that must sleep: 0 or a low number lets one player skip the night, 100 means everyone must sleep (the vanilla Java default is 100).

Good combinations

  • Relaxed survival with friends: keep_inventory true, players_sleeping_percentage 0, spawn_phantoms false. Nobody loses a full inventory in lava and nobody waits for the last player to go to bed.
  • Kids, a school class or a club: add pvp false and mob_griefing false, so nobody can hurt each other and creepers don't blow up builds. See Minecraft server for kids and Minecraft server for a school or club.
  • Building server: advance_time false and advance_weather false together with creative mode, so it's always a clear day.

Game rules or server.properties?

server.properties holds server settings such as difficulty, game mode, whitelist and view distance; they need a restart. Game rules belong to the world, are changed with gamerule and work at once. Both are explained in server.properties explained. Because game rules are stored in the world, they move with it when you upload a singleplayer world.

Running more than one world, for example with Multiverse? On Paper, game rules can differ per world. If a rule works in one world and not in another, run the command again while you stand in that world.

Which plan?

Game rules don't use extra memory. A vanilla or Paper server for a few friends runs on 2 GB (€1.89 per month paid per quarter, €2.19 with monthly billing); with plugins or 5 to 15 players, take 4 GB (€4.19 / €4.39). See Minecraft server hosting.

Frequently asked questions

How do I turn on keepInventory on my Minecraft server? Type gamerule keep_inventory true in the server console (Java 1.21.11 and newer) or gamerule keepInventory true on older Java versions. On Bedrock it is gamerule keepinventory true. No restart is needed.

Why does gamerule keepInventory say unknown game rule? Your server runs Minecraft 1.21.11 or newer, where game rules were renamed to lowercase with underscores. Use keep_inventory instead.

Do I need to restart after changing a game rule? No. Game rules take effect immediately and are saved in the world.

How do I make one player enough to skip the night? Set gamerule players_sleeping_percentage 0 (playersSleepingPercentage on Java before 1.21.11, playerssleepingpercentage on Bedrock).

How do I stop creepers from destroying builds? Set gamerule mob_griefing false. Note that this also stops villagers from farming and endermen from picking up blocks.