Every Java world has a level.dat file at the top of its folder. It holds the settings that apply to the whole world: its name, the default game mode, hardcore, whether cheats are allowed, the difficulty and the spawn point. The game reads it when the world loads and writes it again every time the world saves.
What else lives in the file depends on your version. Up to 1.21.11 it also held the game rules, the seed and, in singleplayer, your whole player. Java 26.1 moved those out into separate files. This guide covers both layouts, so check your version before changing anything.
Before you start
- Close Minecraft, or stop the server. A running game keeps the world in memory and overwrites level.dat when it saves, so your edit would be lost.
- Copy the whole world folder somewhere safe. Minecraft keeps the previous version as
level.dat_old, but that copy changes every time the world saves. - Find the folder: in the game, select the world, click Edit, then Open World Folder. The save locations guide lists the paths for each system.
Which layout does your world use?
Open level.dat in the editor and expand Data then Version. The StrName tag shows the version that last saved the world, and IDataVersion gives the same information as a number. The 1.21.11 file used for the first figure has a DataVersion of 4671.
| Setting | 1.21.10 and older | 1.21.11 | 26.1 and later |
|---|---|---|---|
| Game rules | GameRules, text values | game_rules, Byte and Int values | data/minecraft/game_rules.dat |
| Seed | WorldGenSettings › seed | WorldGenSettings › seed | data/minecraft/world_gen_settings.dat |
| Difficulty | Difficulty (Byte 0–3) | Difficulty (Byte 0–3) | difficulty_settings › difficulty (text) |
| Hardcore | hardcore | hardcore | difficulty_settings › hardcore |
| Singleplayer player | Player compound | Player compound | players/data/<uuid>.dat, named by singleplayer_uuid |
| Weather | raining, rainTime… | raining, rainTime… | data/minecraft/weather.dat |
The world spawn also changed shape. Recent versions store it as a spawn compound with a position, a dimension and a rotation, because the spawn can now be in any dimension. Older worlds use separate SpawnX, SpawnY and SpawnZ Ints.
- { }Data
- BallowCommands0
- IDataVersion4671
- BDifficulty1
- BDifficultyLocked0
- IGameType0
- Bhardcore0
- LLastPlayed1771697593815
- StrLevelName"world"
- { }game_rules
- Bminecraft:keep_inventory0
- Iminecraft:random_tick_speed3
- { }spawn
- Strdimension"minecraft:overworld"
- I[ ]pos[0, 102, 0]
- Fyaw0
- Fpitch0
- { }Version
- StrName"1.21.11"
- { }WorldGenSettings
- Lseed6508918960062323141
- { }Data
- BallowCommands0
- { }difficulty_settings
- Strdifficulty"normal"
- Bhardcore0
- Blocked0
- IGameType0
- StrLevelName"world"
- I[ ]singleplayer_uuid[1172812361, -1416740125, -1823497584, 1309571129]
- { }spawn
The edits people make most
| Goal | Tag | Values |
|---|---|---|
| Allow commands (cheats) | BallowCommands | 1 on, 0 off. Details |
| Turn hardcore off | Bhardcore | 0 off, 1 on. Details |
| Change difficulty (up to 1.21.11) | BDifficulty | 0 peaceful, 1 easy, 2 normal, 3 hard |
| Change difficulty (26.x) | Strdifficulty | peaceful, easy, normal or hard |
| Unlock a locked difficulty | BDifficultyLocked or Blocked | 0 unlocked |
| Default game mode | IGameType | 0 survival, 1 creative, 2 adventure, 3 spectator |
| Name in the world list | StrLevelName | Any text. The folder name doesn't change. |
| Move the world spawn | I[ ]pos inside spawn | Three numbers: X, Y, Z |
Step by step
- Close Minecraft and back up the world folder.
- Open the editor and drop
level.datonto it. The bar above the tree should read Java (big-endian) and gzip. - Expand
Dataand click the value you want to change. Type the new value and press Enter. The badge in front of each name tells you its type: keep Bytes as Bytes, Ints as Ints. - Click Download. The file is saved as
level.datwith the original compression. - Replace the level.dat in your world folder with the downloaded one. If your browser added a number to the name, such as
level (1).dat, rename it back tolevel.dat. - Start Minecraft, open the world and check that the change took effect.
Tags to leave alone
- DataVersion and Version. The game uses them to decide how to upgrade old data. Lowering them does not downgrade a world; it makes the game misread it.
- WorldGenSettings › dimensions. This describes the world generator for each dimension. A mistake here stops the world from loading.
- The seed. Changing it is possible, but only chunks generated afterwards use the new seed, so you get sharp cliffs where old and new terrain meet.
- DataPacks. Use the in-game data pack screen. Editing the list by hand can enable packs the world isn't ready for.
If something goes wrong
The change disappeared. The game was still running and saved over it. Close it completely and edit again.
The world won't load or is missing from the list. Put your backup back. If you have no backup, rename level.dat_old to level.dat: it is the previous save. The corrupted level.dat guide covers the rest.
The editor says a value is out of range. Each type has limits: a Byte holds −128 to 127, for example. Use a value in range, or change the type from the row's ☰ menu if you really need a bigger number.