Dimensions & structures · Java · Intermediate

How to Reset the Ender Dragon Fight and Regenerate End Exit Gateways in level.dat

Sometimes the Ender Dragon fight in Minecraft Java Edition can glitch, leaving you without a dragon egg, a missing exit portal, or unable to generate the twenty outer End gateways. By editing the DragonFight compound inside your world's level.dat file, you can completely reset the battle state and replenish the gateway generation pool. This guide uses our browser-based level.dat Editor, which processes everything locally on your device so your files are never uploaded.

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

What you need

  • A Minecraft Java Edition world folder or .zip file
  • Access to the level.dat Editor on our site
  • A complete backup of your world folder before making any edits

Step by step

  1. 1Back Up Your World and Open the level.dat Editor

    Before modifying any core game data, close Minecraft completely and duplicate your entire world folder as a safe backup. Navigate to our site's level.dat Editor and select 'Open world folder or .zip' to load your save directly into the browser. The tool will parse and locate your level.dat file automatically without sending any data over the internet.

    Tip: If you only want to pick the single file, you can navigate inside your world save and select the level.dat file directly.

  2. 2Locate the DragonFight Compound

    Once the NBT tree loads in the level.dat Editor, expand the root 'Data' compound tag. For Minecraft versions 1.16 and newer, scroll down to expand 'WorldGenSettings', then 'dimensions', then 'minecraft:the_end', and finally click on 'DragonFight'. If you are playing on version 1.15.2 or an older release, look for 'DimensionData' under 'Data', expand capability ID '1', and select 'DragonFight' there.

    Tip: You can use the search bar inside the level.dat Editor and type 'DragonFight' to jump straight to the right node regardless of your game version.

  3. 3Reset the Dragon Battle State Flags

    Inside the 'DragonFight' compound, find the tags named 'DragonKilled' and 'PreviouslyKilled' and change both of their values to 0. Setting 'PreviouslyKilled' to 0 tells the game that the upcoming fight is the very first one, ensuring a new Dragon Egg and full experience points drop upon victory. Next, set 'NeedsStateScanning' to 1 so the game rescans the End island for the obsidian pillars and portal bedrock frame when you next enter the dimension. Finally, if a 'Dragon' tag or UUID exists in this compound, delete it so the game does not wait for an old, non-existent dragon entity.

  4. 4Repopulate the End Exit Gateways List

    Locate the 'Gateways' list tag inside the 'DragonFight' compound, which holds integer IDs from 0 to 19 representing the twenty outer End portals that have not yet been generated. Each time you kill the dragon, the game removes one random number from this list and spawns that specific gateway. To let all twenty gateways generate again, either make sure the 'Gateways' list contains all twenty integers from 0 through 19, or simply delete the 'Gateways' list tag entirely so the game automatically regenerates a full 0-19 list upon resetting the fight.

    Tip: If you regenerate a gateway at a position where one already exists in the world, the game will simply overwrite the bedrock structure at that spot when the dragon dies.

  5. 5Save and Replace Your level.dat File

    Click the Save or Download button in the level.dat Editor to export your modified level.dat file. Move this downloaded file into your Minecraft world save folder, overwriting the original level.dat file. Launch Minecraft, load your world, and enter the End dimension to verify that the battle state has reset.

    Tip: If the dragon does not appear immediately upon entering the End, you may need to place four End Crystals on the exit portal frame to trigger the freshly reset sequence, or also clear the central island's region file.

How it works

In Minecraft Java Edition, the status of the End dimension's boss fight is not stored inside the End's region files, but rather inside the master level.dat file. The 'DragonFight' NBT compound acts as a state machine manager. When 'PreviouslyKilled' is set to 0, the engine treats the next victory as the inaugural kill, awarding 12,000 XP instead of 500 XP and placing a Dragon Egg on top of the central bedrock pillar.

The 'Gateways' tag is an NBT list of 32-bit integers containing the values 0 through 19. These numbers correspond to twenty fixed angles arranged in a circle around the central End island. Whenever a dragon is defeated, Minecraft pops one integer from this list and builds an End Gateway at that radial index. Once the list is empty, killing the dragon spawns no new gateways. By deleting or refilling the list, you restore the pool of available gateway positions.

The 'NeedsStateScanning' byte tag acts as a sanity check for the dimension. When set to 1, the game scans the loaded chunks around coordinates (0, 0) in the End to verify whether the bedrock exit portal and obsidian pillars exist, allowing it to properly link the central mechanics before initiating or resuming the boss battle.

Common mistakes

  • Editing level.dat while the world is still open in Minecraft, which causes the game to overwrite your edits the moment you pause or save and quit.
  • Leaving the 'Dragon' UUID tag intact while setting 'DragonKilled' to 0, which tricks the game into searching endlessly for a specific dragon entity that is no longer in the world.
  • Forgetting to delete or clear the End region files (in the DIM1/region folder) when expecting a newly spawned dragon to appear instantly without placing End Crystals, as existing chunks may already contain an active exit portal frame.
  • Adding numbers higher than 19 or lower than 0 into the 'Gateways' integer list, which can cause errors during gateway generation after the dragon dies.

FAQ

Why didn't the Ender Dragon spawn automatically after I edited level.dat?

If you have already visited the End, the central island chunks are already saved in your DIM1/region folder with an active exit portal. Editing level.dat resets the fight data, so you can either respawn the dragon using four End Crystals to get the first-kill rewards, or delete the DIM1/region folder along with the level.dat edits to regenerate the physical island completely.

Will resetting the DragonFight compound destroy my builds in the End?

No, editing level.dat only changes the fight logic and rules. However, when the dragon respawns or a gateway regenerates, any blocks placed directly on the obsidian pillars, the central exit portal, or the exact coordinates of a newly spawning gateway will be overwritten by the game.

How do I get a second Dragon Egg without using creative mode or commands?

By opening the level.dat Editor and changing 'PreviouslyKilled' to 0 inside the 'DragonFight' compound, the game will automatically generate a brand new Dragon Egg on top of the exit portal the next time you defeat the Ender Dragon.

By resetting the PreviouslyKilled, NeedsStateScanning, and Gateways tags inside the DragonFight compound using our browser-based level.dat Editor, you can easily restore the initial Ender Dragon fight rewards and regenerate missing End exit gateways.

More dimensions & structures guides

Dimensions & structuresHow to Find Exact Structure Bounding Boxes (Fortresses, Witch Huts, Monuments) in Chunk NBTBuilding high-efficiency mob farms for Wither Skeletons, Witches, or Guardians requires knowing the exact coordinates of a structure's bounding box. Even if the physical blocks of a structure are destroyed or altered by terrain generation, the game uses invisible bounding boxes saved in the chunk data to dictate where structure-specific mobs can spawn. This guide teaches you how to inspect raw chunk NBT data using our browser-based tools to find those exact boundaries without your files ever leaving your computer.JavaAdvanced5 steps
Dimensions & structuresHow to View, Trim, or Remove Custom Datapack Dimensions in Your World SaveCustom datapacks and mods often generate their own dimensions, which can bloat your world save size or cause loading errors if the datapack is later removed. This guide shows you how to locate custom dimension namespaces in your Java Edition world folder, inspect their terrain using our browser-based World Map Viewer, and safely trim or delete their region data. Because our tools run locally in your browser, your world files are never uploaded to any server.JavaAdvanced5 steps
Dimensions & structuresHow to Plan Nether Hub Tunnels and Link Portals Using the World Map ViewerBuilding a Nether hub is the fastest way to travel long distances in Minecraft, because every block traveled in the Nether equals eight blocks in the Overworld. However, linking portals across dimensions often goes wrong when lava lakes, huge caverns, or math errors push portals out of alignment. By using our browser-based World Map Viewer, you can preview both dimensions, calculate exact 8:1 coordinates, and plan safe tunnel routes directly from your save files without uploading your world anywhere.Java & BedrockBeginner5 steps
Dimensions & structuresHow to Reset Outer End Cities for Fresh Elytras While Keeping Your Main End IslandOn long-running worlds or multiplayer servers, the End dimension quickly becomes picked clean of Elytras and Shulker shells as players raid every nearby End City. This guide shows you how to reset the outer End islands to regenerate brand-new cities while keeping your central dragon island, Endermen farms, and exit portal completely intact. You can do this safely in your browser using our Chunk Trimmer, which processes your files locally without ever uploading your world.Java & BedrockBeginner5 steps
Dimensions & structuresHow to Reset Trial Chamber Vaults so Players Can Unlock Them AgainIn Minecraft Java Edition, Trial Chamber vaults are designed to only reward each player once by recording their unique ID inside the block itself. If you run a server or want to replay a Trial Chamber in single-player, you can reset these vaults without destroying or replacing the blocks. By using our browser-based NBT Editor, you can safely delete the player memory from specific vaults while keeping your world files completely private on your own computer.JavaAdvanced5 steps