level.dat stores world metadata, but not every setting remains in this file in every Minecraft release. In the legacy layout it includes game rules, player data, difficulty, and generation settings. Java 26.1 moved several of these into separate files. Inspect your world's version and actual structure before choosing a tag to edit.
Where is level.dat?
In Java Edition, every world is a folder inside your .minecraft directory, and level.dat sits directly inside that world folder:
.minecraft/saves/<world name>/level.datOn Windows the .minecraft folder is usually at %APPDATA%\.minecraft, on macOS at ~/Library/Application Support/minecraft, and on Linux at ~/.minecraft. On a dedicated server, level.dat is inside the world folder you configured in server.properties (often called "world").
The two rules before you touch anything
- Back up the whole world folder first. Copy it somewhere safe, or at least copy level.dat to level.dat.bak. Invalid NBT can stop a world from loading, so you always want a way back.
- Stop the game or server before editing. Minecraft writes world data to disk when it saves, and a running game or server can silently overwrite your manual changes. On a server, use the stop command and wait for it to shut down completely before replacing files.
How to edit level.dat with Chunkweave
Chunkweave opens Java Edition level.dat files in your browser, shows the typed NBT tree, and exports a separate copy. Nothing is uploaded; the file is processed locally on your device.
- Back up the world folder (copy level.dat to level.dat.bak at minimum).
- Open the Chunkweave NBT editor and select level.dat from your world folder.
- Expand the Data compound to reach the tag you want to change.
- Edit the value while preserving its existing tag type, review the staged change, and select Apply changes.
- Download the edited copy as a separate file.
- Rename the original level.dat to level.dat_old, place the new file in the world folder, and load the world to test it.
Open your level.dat file
Select level.dat from your world folder and edit it locally in your browser.
The most useful edits
Change the game mode
In worlds that contain Data/GameType, this integer sets the default game mode: 0 Survival, 1 Creative, 2 Adventure, or 3 Spectator. An existing player may have a separate playerGameType in their player data, so changing only the world default may not change that player's mode.
Change game rules such as keepInventory
Older worlds use Data/GameRules; a String keepInventory value uses true or false, not numeric 1 or 0. Java 1.21.11 renamed game rules, and 26.1 moved them to data/minecraft/game_rules.dat. Follow the keepInventory guide's version table and preserve the existing tag type.
Move the spawn point
The world spawn is stored in Data/SpawnX, Data/SpawnY, and Data/SpawnZ as integers. Set the coordinates you want, and new players will spawn there.
Change the time of day
In the legacy layout, Data/DayTime controls the day/night cycle in ticks: 0 sunrise, 6000 midday, 12000 sunset, 18000 midnight. Data/Time is elapsed world age, not the same clock. For an old String doDaylightCycle rule, false pauses the cycle; preserve the original type. Java 26.1 moved world-clock storage out of level.dat.
Change difficulty
Data/Difficulty stores a byte value: 0 for Peaceful, 1 for Easy, 2 for Normal, and 3 for Hard. Note that the game may still enforce a locked difficulty if you enabled it in the world options.
Change the world seed
In modern Java Edition versions the seed is stored in Data/WorldGenSettings/seed as a long integer. Changing it only affects terrain generated after the change; chunks that already exist are not regenerated.
Where is player data stored?
In singleplayer, your player data is stored inside level.dat under the Player compound. On a server, each player has a separate UUID-named .dat file in the playerdata folder. The difference trips up a lot of people, so read the playerdata guide before you go looking for the wrong file.
Frequently asked questions
Do I need cheats to edit level.dat?
No. Editing level.dat changes the saved world directly, so it works without enabling cheats or using commands.
Can editing level.dat break my world?
It can if a value is invalid for your game version or mods. Keep a backup of the whole world folder and test the edited file on a copy first.
Why did my level.dat change not stick?
The game or server was probably still running when you replaced the file, and its next save overwrote your edit. Stop the game or server, apply the change, then start it again.
Does Chunkweave upload my level.dat?
No. Chunkweave parses, edits, and rebuilds the file locally in your browser and never uploads its contents.