
level.dat & world settings · Java & Bedrock · Beginner
How to Permanently Enable Cheats and Change Default Gamemode in level.dat
Using the Open to LAN workaround in Java Edition only enables commands temporarily until you exit the world, while Bedrock Edition locks you out of certain settings once a world is created. By directly editing your world's level.dat file, you can permanently toggle cheats, change the default gamemode, and unlock difficulty settings. This guide shows you how to safely modify these global rules directly in your browser without uploading any files.
What you need
- Access to your Minecraft world folder, or an exported .zip / .mcworld archive (Java or Bedrock Edition)
- A complete backup copy of your world folder before making any edits
- The level.dat Editor on our site (runs locally in your browser)
Step by step
1Close Minecraft and Back Up Your World
Before touching any data files, save and quit your world, then close Minecraft completely. If the game is still running, it will overwrite your manual changes when you exit or cause file corruption. Navigate to your game's saves folder (saves in Java Edition, or minecraftWorlds in Bedrock Edition) and duplicate your entire world folder as a backup.
Tip: Always keep your backup in a separate folder on your desktop so you can easily restore it if something goes wrong.
2Load Your World into the level.dat Editor
Open the level.dat Editor on our site. Click Open world folder or .zip and select your world directory, or choose the level.dat file directly from inside that folder. Because the tool runs entirely inside your browser, your world files are read directly from your device and are never uploaded to a server. In Java Edition, look under the Data compound tag to find the main settings; in Bedrock Edition, the tags sit right at the root level.
3Permanently Enable Cheats (allowCommands)
Locate the tag named allowCommands in the editor list. Note that in Bedrock Edition, this exact tag might sometimes appear with a capital A as AllowCommands, so check for both. Change its value from 0 (false) to 1 (true). This tells the game engine that singleplayer operator commands like /gamemode and /give are permanently authorized for this save.
Tip: If you are turning a Hardcore world into a normal Survival world, also find the hardcore tag and set it from 1 to 0.
4Change Default Gamemode and Personal Gamemode
Find the GameType tag, which sets the default gamemode for the world, and change its integer value: 0 is Survival, 1 is Creative, 2 is Adventure, and 3 is Spectator (or 6 for Spectator in some Bedrock versions). However, changing GameType only affects new players or default rules. For singleplayer Java worlds, you must also expand the Player compound tag inside level.dat, find playerGameType, and set it to the exact same number so your character's current state updates immediately.
5Adjust and Unlock World Difficulty
If you locked your difficulty on creation and want to change it, first locate the DifficultyLocked tag and change it from 1 to 0. Next, find the Difficulty tag and set it to your preferred level: 0 for Peaceful, 1 for Easy, 2 for Normal, or 3 for Hard. Unlocking it ensures you can also freely change the difficulty later using the normal in-game pause menu.
6Save and Replace Your level.dat File
Click the Save or Download button in the level.dat Editor to generate your modified level.dat file. Move this new file into your world folder and choose to overwrite the existing level.dat file. Launch Minecraft, load your world, and test typing a command or checking your gamemode to verify the changes took effect.
Tip: If you find a level.dat_old file in your folder, leave it alone or replace it as well; Minecraft uses it as an automatic fallback backup.
How it works
Every Minecraft world relies on a master index file named level.dat, which is formatted using NBT (Named Binary Tag) structure. While region files and the db folder store the actual blocks and terrain, level.dat stores global world metadata: the seed, time of day, weather, game rules, and permissions. In Java Edition, this file is GZip-compressed, while Bedrock Edition uses a slightly different uncompressed NBT format with a small header.
When you use the Open to LAN trick in Java Edition, the game temporarily grants your session operator privileges in active memory without ever rewriting the allowCommands byte on your hard drive. By editing level.dat directly and changing allowCommands from 0 to 1, you alter the permanent configuration flag that Minecraft reads the moment the world boots up.
Similarly, Minecraft separates the world's default gamemode (GameType) from an individual player's current gamemode (playerGameType). When you load a singleplayer Java world, the engine prioritizes the data inside the Player compound tag over the world default. Understanding this distinction explains why simply changing the global GameType often fails to put your character into Creative mode upon loading.
Common mistakes
- Editing level.dat while the world is still open in Minecraft, which causes the game to immediately overwrite your newly saved file with the old data held in memory.
- Changing GameType to Creative (1) in Java Edition without also changing playerGameType inside the Player compound tag, resulting in you still spawning in Survival mode.
- Leaving your downloaded file named level (1).dat instead of renaming it to exactly level.dat when placing it back into your world folder.
- Forgetting to set hardcore to 0 when trying to switch a Java Edition Hardcore world into Creative or standard Survival mode.
FAQ
Will enabling cheats in Bedrock Edition disable achievements?
Yes. In Bedrock Edition, setting allowCommands to 1 or GameType to 1 (Creative) will trigger another tag called hasBeenLoadedInCreative to become 1, which permanently disables Xbox achievements for that specific world.
Why didn't my gamemode change in Bedrock Edition after editing GameType?
Like Java Edition, Bedrock saves your personal player state separately from the world default. While global cheats (allowCommands) and difficulty in level.dat apply immediately, Bedrock stores your personal player data inside the leveldb database folder rather than inside level.dat. Once you enable allowCommands in level.dat, simply load the world and type /gamemode c in the chat.
Is it safe to use a browser tool for my 2GB world folder?
Yes, because the level.dat file itself is tiny—usually only a few kilobytes—and our level.dat Editor processes everything locally in your browser's memory without ever uploading your data over the internet.
By toggling allowCommands, GameType, and Difficulty inside the level.dat Editor and replacing your original file, you can permanently unlock commands and customize rules in any Minecraft world.