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.

Open the level.dat EditorChange world name, game mode, difficulty, hardcore, cheats, spawn, time and weather.

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

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

More level.dat & world settings guides

level.dat & world settingsHow to View or Change Your World Seed and WorldGenSettings in level.datYour Minecraft world's terrain generation rules and seed are stored inside the master configuration file known as level.dat. Using our browser-based level.dat Editor, you can easily inspect or replace the generation seed for the Overworld, Nether, and End without uploading any of your files to a server. This guide covers both Java Edition (including the modern WorldGenSettings compound) and Bedrock Edition.Java & BedrockIntermediate6 steps
level.dat & world settingsHow to Change the Global World Spawn Point Coordinates in level.datThe global world spawn point determines where brand-new players enter your Minecraft world, where players return if their bed is destroyed, and which direction standard compasses point. By editing the world configuration directly inside the level.dat file, you can relocate this central hub to any coordinate without needing in-game cheats enabled. Using our browser-based level.dat Editor, your files are processed locally on your device and never uploaded to any server.Java & BedrockBeginner5 steps
level.dat & world settingsHow to Edit Minecraft GameRules Offline Using the level.dat EditorModifying Minecraft GameRules offline allows you to adjust core world behaviors—like keeping your inventory upon death or stopping Creepers from destroying blocks—before you even load into the game. By editing the level.dat file directly, you can change these rules without needing to enable in-game cheats or lose advancement eligibility. This guide walks you through safely updating your world's configuration for both Java and Bedrock editions using our browser-based level.dat Editor.Java & BedrockBeginner5 steps
level.dat & world settingsHow to Enable Experimental Features and Datapacks on an Existing WorldNormally, Minecraft locks experimental features and built-in experimental datapacks behind the world creation screen, forcing you to start a new game to test upcoming mechanics. By directly editing your world's root configuration file, you can unlock these experiments on an existing survival save without losing your progress. Our browser-based level.dat Editor lets you modify these feature flags safely and locally on your device without uploading any files.Java & BedrockIntermediate6 steps
level.dat & world settingsHow to Reset World Day Counter, Time of Day, and Weather State in level.datResetting your Minecraft world's day counter, time of day, and weather state is useful when preparing custom maps or starting a fresh chapter on an existing survival world. While in-game commands can alter the sun's position, they often just add ticks to the internal clock, making the day counter jump forward instead of resetting to zero. Using our browser-based level.dat Editor, you can safely adjust these exact NBT tags directly on your device without uploading any files.Java & BedrockBeginner5 steps
level.dat & world settingsHow to Convert a Hardcore World Back to Survival After DyingDying in a Minecraft Java Edition Hardcore world locks you into Spectator mode, preventing you from interacting with your builds ever again. Fortunately, the game stores your world's rules and your personal gamemode as simple data tags inside a single configuration file. By using our browser-based level.dat Editor, you can safely flip these tags back to normal Survival mode without uploading your files to any server.JavaBeginner6 steps