Editing a saved rule does not require running a command. You still need permission to manage the world files. On a hosted server, the owner or administrator must make the change while the server is stopped. This guide covers Java Edition; Bedrock has different storage and is not supported by this editor.
Where game rules are stored
Use the world layout that actually exists on disk. The legacy path below is not valid for every current version:
| Java world layout | Where to look | Rule name |
|---|---|---|
| Before 1.21.11 | level.dat → Data → GameRules | keepInventory |
| 1.21.11 | level.dat → Data → game_rules | minecraft:keep_inventory |
| 26.1 storage change | data/minecraft/game_rules.dat | Search for minecraft:keep_inventory in the existing structure |
Data/GameRules/keepInventoryRead the existing tag's type before editing. A String boolean uses the text true or false. A Byte boolean uses 1 or 0. Do not replace a String with a Byte or enter 1 into a String rule. The editor keeps the original type; a syntactically valid NBT value is not proof that Minecraft will interpret it as intended.
Legacy game-rule examples (before 1.21.11)
| Legacy rule | Meaning of the value | Effect |
|---|---|---|
| keepInventory | true enables; false disables | Keep items on death |
| doDaylightCycle | true advances; false pauses | Day and night cycle |
| doWeatherCycle | true advances; false pauses | Weather cycle |
| mobGriefing | true allows; false prevents | Mob changes to the world |
| doMobSpawning | true allows; false prevents | Natural mob spawning |
| doFireTick | true allows; false prevents | Legacy fire spread |
| naturalRegeneration | true enables; false disables | Natural health regeneration |
| randomTickSpeed | A whole number, often stored as a String in legacy files | Random block-update rate |
The table describes rule meanings, not an instruction to change NBT types. Preserve the type found in the file. Several names also changed in 1.21.11: doDaylightCycle became minecraft:advance_time, and doFireTick was replaced rather than simply renamed.
Step by step with Chunkweave
- Back up the whole world folder and record its Minecraft version.
- Stop the game or server so it cannot overwrite your edit.
- Open level.dat or data/minecraft/game_rules.dat according to the version table.
- Find the existing keepInventory or minecraft:keep_inventory entry and inspect its type.
- For a String tag enter true; for a Byte boolean enter 1. Keep the tag type unchanged.
- Select Apply changes, then Download copy. Record the old value so you can undo the edit.
- Place the exported file at the same path in a backed-up test world, retaining the filename expected by Minecraft. Load it, verify the rule, and confirm it survives a save and restart before using it in the live world.
Change game rules in your browser
Open the file selected from the version table, inspect the original type, and export a separate copy.
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?
Inspect the existing type. Legacy String boolean values use true or false; Byte booleans use 1 or 0. Java 1.21.11 also renamed the rule, and 26.1 moved rule storage into a separate file. Do not add an old-format rule to a newer world.
Will my game rule change survive a server restart?
It should persist if the correct file and rule were saved with the server stopped. Plugins, the wrong file path, or invalid serialization can undo or ignore it. Test a save and restart on a backup.
Which game rules can I set this way?
Rules actually stored by your Minecraft version. Older worlds use GameRules; current layouts can use namespaced names in a separate game_rules.dat file. Match the version rather than copying the legacy names from this article.