Game rules guide

keepInventory and other game rules without cheats

You do not need cheats to change game rules like keepInventory. The rules are saved in level.dat, so editing that file directly changes them permanently - even on worlds where commands are disabled.

Published 2026-08-056 min read

The gamerule command requires cheats or operator permissions, but the rules themselves are just values stored in the world. Edit level.dat and you can change keepInventory, doDaylightCycle, mobGriefing, and many other rules on any world, no cheats needed.

Where game rules are stored

Game rules live in the GameRules compound inside level.dat:

NBT path
Data/GameRules/keepInventory

The keepInventory rule is a byte tag: 0 means off (items drop on death) and 1 means on (items are kept). To enable it, open level.dat in an NBT editor, find Data/GameRules/keepInventory, and change its value to 1.

Common game rules and their values

Game ruleTypeDefaultEffect
keepInventorybyte0Keep items on death
doDaylightCyclebyte1Day and night advance
doWeatherCyclebyte1Weather changes over time
mobGriefingbyte1Mobs can change the world
doMobSpawningbyte1Mobs spawn naturally
doFireTickbyte1Fire spreads and burns out
naturalRegenerationbyte1Health regenerates on full hunger
randomTickSpeedint3Random block updates per tick

Byte rules use 0 for false and 1 for true. randomTickSpeed is an integer; 0 disables random ticks entirely, which can stop crops from growing and fire from spreading.

Step by step with Chunkweave

  1. Back up the world folder, or at least level.dat.
  2. Stop the game or server so it cannot overwrite your edit.
  3. Open level.dat in the Chunkweave NBT editor.
  4. Expand Data, then GameRules, and find keepInventory.
  5. Change the value to 1 and download the edited copy.
  6. Replace level.dat in the world folder and load the world.
Edit GameRules directly

Change game rules in your browser

Open level.dat, navigate to Data/GameRules, and set the rule you need.

Open the level.dat editor

Why not just use the gamerule command?

The gamerule command is the normal way to change rules, but it needs cheats in singleplayer or operator permission on a server. Editing level.dat changes the same saved values without any of that, which is why it is the standard answer for worlds where commands are locked.

Frequently asked questions

Does editing keepInventory in level.dat require cheats?

No. You are changing the saved world file directly, so it works on worlds with cheats disabled.

What type is keepInventory in level.dat?

It is a byte tag: 0 disables it and 1 enables it. If the rule does not exist in GameRules, add it as a byte tag.

Will my game rule change survive a server restart?

Yes. Because the value is saved in level.dat, it persists across restarts and does not depend on commands or operators.

Which game rules can I set this way?

Any rule that Minecraft stores in the GameRules compound. Common ones include keepInventory, doDaylightCycle, doWeatherCycle, mobGriefing, and doMobSpawning.

Ready when your file is

Inspect the structure before you change it.

Open a supported Minecraft Java Edition file, stage edits, and export a separate copy without sending world data to a server.

Open the NBT editor