Complete Game Rule Guide: Keep Inventory and Other /gamerule Commands
Minecraft keep inventory command: /gamerule keep_inventory true (renamed from keepInventory in 1.21.11). Also find the defaults and easy-to-read explanations for all game rules, including mob griefing, permanent daytime, disabling weather, and immediate respawn.
Minecraft keep inventory command: For 1.21.11 and later, enter /gamerule keep_inventory true, for 1.21.10 and earlier, enter /gamerule keepInventory true. When enabled, your inventory items and experience are kept when you die. Set it back to false to turn it off. This page lists all game rules and their default values for the selected version.
Frequently Asked Questions
What's the keep inventory command?
1.21.11 and later:/gamerule keep_inventory true;1.14 ~ 1.21.10:/gamerule keepInventory true. This game rule applies to the entire world, so no players drop items or experience when they die. In newer versions, using the old name returns “Unknown game rule”—that's why many online tutorials no longer work.
How do I make it permanently daytime?
First, run /time set day, then stop time from advancing: for 1.21.11 and later, /gamerule advance_time false, while earlier versions use /gamerule doDaylightCycle false。
How do I stop the rain and keep it sunny?
First, run /weather clear, then stop the weather from changing: for 1.21.11 and later, /gamerule advance_weather false, while earlier versions use /gamerule doWeatherCycle false。
What's the anti-griefing command (so Creepers don't blow up blocks)?
1.21.11 and later /gamerule mob_griefing false, while earlier versions use /gamerule mobGriefing false. Once disabled, explosions from Creepers, Ghasts, and other mobs won't break blocks, but Villagers won't harvest crops and Endermen won't pick up blocks. This game rule does not affect TNT.
What should I do if a game rule command has no effect or returns an error?
First, make sure you have permission: in singleplayer, enable “Allow Cheats” when creating the world (or temporarily enable it by opening an existing world to LAN); on a server, you need operator (OP) permissions. Then make sure the game rule name matches your version: select your Minecraft version in the top-right corner. This page only lists game rules available in that version.