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:
Data/GameRules/keepInventoryThe 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 rule | Type | Default | Effect |
|---|---|---|---|
| keepInventory | byte | 0 | Keep items on death |
| doDaylightCycle | byte | 1 | Day and night advance |
| doWeatherCycle | byte | 1 | Weather changes over time |
| mobGriefing | byte | 1 | Mobs can change the world |
| doMobSpawning | byte | 1 | Mobs spawn naturally |
| doFireTick | byte | 1 | Fire spreads and burns out |
| naturalRegeneration | byte | 1 | Health regenerates on full hunger |
| randomTickSpeed | int | 3 | Random 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
- Back up the world folder, or at least level.dat.
- Stop the game or server so it cannot overwrite your edit.
- Open level.dat in the Chunkweave NBT editor.
- Expand Data, then GameRules, and find keepInventory.
- Change the value to 1 and download the edited copy.
- Replace level.dat in the world folder and load the world.
Change game rules in your browser
Open level.dat, navigate to Data/GameRules, and set the rule you need.
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.