[MC-104736] DragonFight data is not completely restored after corruption from MC-103497 Created: 27/Jun/16  Updated: 15/Apr/18

Status: Open
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.10.2, Minecraft 16w38a, Minecraft 1.11.2
Fix Version/s: None

Type: Bug
Reporter: Anomie X Assignee: [Mojang] ProfMobius (Thomas Guimbretiere)
Resolution: Unresolved Votes: 16
Labels: end, end-gateway, end-portal, ender-dragon-fight, ender-dragon-respawn, ender_dragon

Attachments: PNG File 2016-12-17_12.21.36.png     File level.dat     Zip Archive New World-.zip     PNG File Untitled.png    
Issue Links:
Cloners
clones MC-103497 End Dragon Does not respawn Resolved
Duplicate
is duplicated by MC-104966 Additional end gateways not spawning ... Resolved
is duplicated by MC-105496 Ressumoned ender dragon and ender eye... Resolved
is duplicated by MC-105768 End Gateway Portal not generating aft... Resolved
is duplicated by MC-107325 Ender Dragon Will Not Respawn Resolved
is duplicated by MC-111499 endcity gateways not spawning Resolved
is duplicated by MC-111986 End Gateway not created Resolved
is duplicated by MC-112280 No new end portals spawning after kil... Resolved
is duplicated by MC-117927 No new gateway after re spawning and ... Resolved
Relates
relates to MC-104897 Ender Crystals placed on pre-1.9 exit... Reopened
CHK:
Confirmation Status: Confirmed

 Description   
Workaround
Dragon cannot be respawned

Try the methods described in this comment to correct the ExitPortalLocation.

Existing end gateways are regenerated

If you respawned the ender dragon as often as you had end gateways the next end gateway will generate correctly. For example if you had one end gateway and it was regenerated, the next ones will generate correctly and you will after all have all 20 gateways.

In case you did not respawn the dragon as often as there are end gateways you will have to edit the NBT data of the world. Be careful with this method and make a backup of your world before trying it.

  1. Open the level.dat file of the affected world with a NBT editor such as NBTExplorer
  2. Navigate to DimensionData1DragonFightGateways
  3. Remove as many items (beginning at the top) as not regenerated gateways in your world exist. For example: There were 2 gateways. One was regenerated which lead you to this report. This means there is still one which was not regenerated, therefor you have to remove the first item from the list.

The bug

MC-103497 was about the <DragonFight> tag inside level.dat not being saved if no player visited the end during a server session, and then being regenerated incorrectly. This is now fixed. However, worlds that were affected by the bug do not have the regenerated data corrected.

  1. If <ExitPortalLocation> was regenerated prior to 1.10.1, it has an incorrect <Y> value that does not correspond to the actual portal in the world.
  2. The <Gateways> tag when regenerated contains the entire original list of gateways, thus killing the dragon will recreate existing gateways before opening new ones.

As a workaround, both of these can be easily fixed by using an NBT editor to fix level.dat.



 Comments   
Comment by Helder Dias [ 15/Aug/16 ]

Hi.
Would it be possible to add a detailed explanation on how to fix this in the level.dat.
I'm already able to open, change and save the file in a NBT editor, so you can skip this part.
Thank you.

Comment by [Mod] Marcono1234 [ 15/Aug/16 ]

You can try using the possible solutions Anomie X provided

Comment by Helder Dias [ 15/Aug/16 ]

Thank you.
Although I skipped everything and just placed the cristals 1 block lower.
It worked.

Comment by RimaNari [ 19/Sep/16 ]

I am not sure whether this is the right place to post this, but I couldn't find a better place on the bug tracker and doubt it belongs anywhere else then on the bug tracker.

Situation: World created pre-1.9 and dragon slain pre-1.9. In 1.10.2 trying to respawn dragon for first time with four ender crystals at the normal positions on the single existing portal. The level.dat file shows a <DragonFight> tag, it also has the <Gateways> tag and the other two tags indicating whether a dragon fight is underway and how often the dragon was slain. The <ExitPortalLocation> tag is missing.

What happens: After placing the end crystals they are back in the inventory after re-logging or clicking the now empty inventory slot. Like if there are connection issues and the client thinks ahead wrongly. The placed end crystals (they have fire beneath, not sure whether intended) don't re-spawn the dragon, but are explosive.

Solution: When I place a single end crystal one block lower (breaking the bedrock beforehand) - I don't even have to place more then this single end crystal - a new portal gets generated in the middle of the island. The <ExitPortalLocation> tag is then created. The old portal still works. The new portal then behaves correctly, re-spawning the ender dragon as soon as the end crystals are placed correctly at this new portal.

Around the time when I place the end crystals at the position I would expect them to be placed (before forcing the creation of the second portal by removing bedrock and placing crystals on block lower) and nothing actually happens, the following errors get reported:

server log
[21:05:16] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_101]
	at h.a(SourceFile:46) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.D(SourceFile:598) [minecraft_server.jar:?]
	at ld.D(SourceFile:338) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.C(SourceFile:554) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.run(SourceFile:458) [minecraft_server.jar:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.lang.NullPointerException
	at atq.e(SourceFile:461) ~[minecraft_server.jar:?]
	at adj.a(SourceFile:60) ~[minecraft_server.jar:?]
	at adz.a(SourceFile:143) ~[minecraft_server.jar:?]
	at lv.a(SourceFile:344) ~[minecraft_server.jar:?]
	at me.a(SourceFile:627) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:55) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:11) ~[minecraft_server.jar:?]
	at fl$1.run(SourceFile:13) ~[minecraft_server.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_101]
	at h.a(SourceFile:45) ~[minecraft_server.jar:?]
	... 5 more
[21:05:20] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_101]
	at h.a(SourceFile:46) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.D(SourceFile:598) [minecraft_server.jar:?]
	at ld.D(SourceFile:338) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.C(SourceFile:554) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.run(SourceFile:458) [minecraft_server.jar:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.lang.NullPointerException
	at atq.e(SourceFile:461) ~[minecraft_server.jar:?]
	at adj.a(SourceFile:60) ~[minecraft_server.jar:?]
	at adz.a(SourceFile:143) ~[minecraft_server.jar:?]
	at lv.a(SourceFile:344) ~[minecraft_server.jar:?]
	at me.a(SourceFile:627) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:55) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:11) ~[minecraft_server.jar:?]
	at fl$1.run(SourceFile:13) ~[minecraft_server.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_101]
	at h.a(SourceFile:45) ~[minecraft_server.jar:?]
	... 5 more
[21:06:54] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_101]
	at h.a(SourceFile:46) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.D(SourceFile:598) [minecraft_server.jar:?]
	at ld.D(SourceFile:338) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.C(SourceFile:554) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.run(SourceFile:458) [minecraft_server.jar:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.lang.NullPointerException
	at atq.e(SourceFile:461) ~[minecraft_server.jar:?]
	at adj.a(SourceFile:60) ~[minecraft_server.jar:?]
	at adz.a(SourceFile:143) ~[minecraft_server.jar:?]
	at lv.a(SourceFile:344) ~[minecraft_server.jar:?]
	at me.a(SourceFile:627) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:55) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:11) ~[minecraft_server.jar:?]
	at fl$1.run(SourceFile:13) ~[minecraft_server.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_101]
	at h.a(SourceFile:45) ~[minecraft_server.jar:?]
	... 5 more
[21:06:57] [Server thread/FATAL]: Error executing task
java.util.concurrent.ExecutionException: java.lang.NullPointerException
	at java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.get(FutureTask.java:192) ~[?:1.8.0_101]
	at h.a(SourceFile:46) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.D(SourceFile:598) [minecraft_server.jar:?]
	at ld.D(SourceFile:338) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.C(SourceFile:554) [minecraft_server.jar:?]
	at net.minecraft.server.MinecraftServer.run(SourceFile:458) [minecraft_server.jar:?]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_101]
Caused by: java.lang.NullPointerException
	at atq.e(SourceFile:461) ~[minecraft_server.jar:?]
	at adj.a(SourceFile:60) ~[minecraft_server.jar:?]
	at adz.a(SourceFile:143) ~[minecraft_server.jar:?]
	at lv.a(SourceFile:344) ~[minecraft_server.jar:?]
	at me.a(SourceFile:627) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:55) ~[minecraft_server.jar:?]
	at jj.a(SourceFile:11) ~[minecraft_server.jar:?]
	at fl$1.run(SourceFile:13) ~[minecraft_server.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_101]
	at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_101]
	at h.a(SourceFile:45) ~[minecraft_server.jar:?]
	... 5 more

I am posting this because it look very similar to the issue described here, but is still different. According to the description of Anomie X here my world would be in "state #3", which should be fixed, however it is not fixed apparently. The only faulty behaviour is expected from a world in "state #4" according to this description, but this is apparently not the case exclusively.

Comment by [Mod] Marcono1234 [ 19/Sep/16 ]

RimaNari, I would suggest creating a new report with for example the name "DragonFight: Respawn fails setting old found portal as exit portal after upgrading"

The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

In 1.10 the method net.minecraft.world.end.DragonFightManager.respawnDragon() set if no portal was found the position of the new portal as local portal location (lines after debug message "Couldn't find a portal, so we made one.") and if it found one it used that position (line after debug message "Found the exit portal & temporarily using it.").

Now in 16w36a it always uses the exit portal location and relies on the method auj.h() (MCP 9.30 net.minecraft.world.end.DragonFightManager.findExitPortal()) to set the exit portal. However, this only happens if the portal was found at 0, 0. When in line 464 the game then tries to add 1 to the y coordinate of the local exit portal location, a NullPointerException happens because this position is still null.

Comment by [Mod] Neko [ 19/Sep/16 ]

RimaNari & [Mod] Marcono1234, does MC-104897 describe your issue?

Comment by [Mod] Marcono1234 [ 19/Sep/16 ]

Yes, very likely. It looks like the exception is the same. Can you link to the comment above as code analysis please?

Edit: Beside the fact that I watched the report I also noticed that it already contained a code analysis...

Sorry for that.

Comment by RimaNari [ 20/Sep/16 ]

[Mod] Neko, thank you. MC-104897 describes the issue I am experiencing perfectly. It's a shame that the bug tracker is flooded with non-descriptive mainly unclear or duplicate bug reports that show up when searching for an issue, therefore not finding what you are actually looking for.

Thanks anyways for the code analysis [Mod] Marcono1234, it makes this quirky behaviour somewhat more understandable

Comment by RimaNari [ 17/Dec/16 ]

Bill Bergovoy The intent of the bug tracker is not to provide useful information to players how to play around a bug, but to devs on how to fix bugs. This comment functionality is also not intended as a place for general discussions that go beyond anything that helps track down a bug. For more general discussions please refer to the Mojira subreddit.

As such, it is entirely normal to mention NBTedit, as everyone posting here is expected to be someone that is willing to help track down bugs and therefore often is familiar to the concept of NBT data and the usage of NBTedit. Bluntly said: The bug tracker is not a place for "regular" persons to understand and this is entirely intentional and fine.

Comment by [Mod] Marcono1234 [ 17/Dec/16 ]

@RimaNari please don't create links for bug reports, just write the name, for example MC-104736 and a link will be automatically created. The advantage of this is that it displays the report name as strike through when it is closed and the the summary is shown when you hover over the link.

@Bill Bergovoy as RimaNari said this is no support forum which is why you might not get an answer immediately. It is often better to comment on the closed report because the moderator who closed it is often still watching it whereas it is not guaranteed that he watches the report your report was resolved to. The problem with this bug tracker is, as you might have noticed already, that you currently get a mail for anything that changed a report somehow, including commenting and even editing a comment. Therefor please try to not start a conversation here but instead use like already said the subreddit. I hope this comment answers your questions and there is no need for you to create a reddit account.
If I understand it correctly you only experienced the second part of this bug: "The <Gateways> tag when regenerated contains the entire original list of gateways, thus killing the dragon will recreate existing gateways before opening new ones." This solves itself as soon as all the end gateways were regenerated, which happened apparently for you because you only had one before. Therefor there should not be any more bad side effects.
The problem that a second gateway back to the main island was created might be indeed a different bug. I tried reproducing it and was unable to do so, but because it is very likely caused by this bug it is probably not worth it to have a seperate report for it. You will have to remove it manually, for example by opening the world to LAN, allowing cheats and then change your gamemode to remove the blocks.
And one general thing in the end: Based on your screenshot you are using OptiFine. Always try to reproduce a bug with an unmodded version of Minecraft because otherwise the mod might cause it.

Comment by Bill Bergovoy [ 17/Dec/16 ]

yes, I understand everything. I will remove the second gateway manually. I did go back to the end and killed the dragon in creative mode and another gateway was generated, and after going back and forth a few times, there was no sign of the second gateway.

I think I am all good now.. sorry for any confusion I caused. I did start a reddit account and found the minecraft area.

thank you for this help, and all the work you have done to get this game as awesome that it is. I am older guy, and can't stop playing it. thank you..

RESOLVED

Comment by Steven Bentley [ 06/Jan/17 ]

I have the no dragon respawn issue. My world was created in 1.8 and I tried to respawn it for the first time in 1.11.2. No luck.

I used an MBT editor as suggested in the workaround comment linked above. I have situation 3 (The world was affected, and currently has <DragonFight> but not <ExitPortalLocation>) but the comment claims that this is now fixed, but I still can't spawn the dragon.

I attached my level.dat and a screenshot of the portal.

Comment by RimaNari [ 06/Jan/17 ]

I was able to re-create your situation by loading a pre-1.9 world in 1.11.2. The same holds true when in 1.10.2, so it's nothing new in the 1.11 version. It appears as if the above linked comment describing the four possible situations is incorrect: situation three is not fixed by the legacy scanning that kicks in when entering the end. My server log shows

[Server thread/INFO]: Scanning for legacy world dragon fight...
[Server thread/INFO]: Found that the dragon has been killed in this world already.

directly after entering the end, which I believe indicates that the legacy scanning indeed happens.

This issue is certainly not yet fixed - and also persists in 1.11.2. Can someone update the affected version list?

To workaround the issue: Switch top creative mode and break one of the bedrock blocks on the exit portal on which you would place your end crystals on top. Place a new bedrock block below the broken one and place an end crystal on top. This should trigger the creation of the correct exit portal (may take a couple of seconds) on which you can respawn the ender dragon as expected. To make sure the old exit portal will be disabled, return it to its original state (remove the end crystal and the placed bedrock block and add the bedrock block to the rim again) and spawn the dragon once (using the new portal). The game will then correctly find the old portal and replace it with end stone.

Comment by Steven Bentley [ 06/Jan/17 ]

Perfect. The workaround suggested worked. Found a way to break the portal in survival and respawned it. Now dragon summoning works fine.

Much appreciated. Would like the bug to be fixed for others though as its taken a good few hours of searching and trying different things for me to get this sorted.

Comment by Dolf Gulicher [ 06/Jan/17 ]

RimaNari, thank you for your response.

My <DragonFight> had 3 entries, Gateways (which had 20 gates in apparent random order from 0 to 19), DragonKilled 1 and PreviouslyKilled 1
I removed from the top down 19 gates(only nr 13 left) and used the work around as in the tutorial, however nothing eventuates.
There is no <ExitPortalLocation> either. Any other suggestions? I hate to have to abandon this world as there is a lot of work in it.

Thanks

Comment by RimaNari [ 07/Jan/17 ]

@Dolf Gulicher: This is the same situation as for Steven Bentley and the same situation that I re-created for testing. The workaround I posted several comments up should apply, as the game will get triggered to create the correct exit portal and create the ExitPortalLocation entry in the NBT data correctly if it is missing. If the trick explained in the linked video doesn't work try the other method using creative mode (removing the bedrock block and placing the end crystal one block lower). This should create a new exit portal at coordinates 0, 0. If this does not work for you, can you upload your world (stripped of overworld and nether) for me and others to examine?

Deleting the gateway entries was probably contra-productive, however it won't interfere with the dragon respawn issue. I believe with only one gateway entry left the game will only create a single gateway now, no matter how often you kill the dragon. (You should probably use a made backup of your level.dat file to get the gateway entries back. Maybe deleting the entire DragonFight entry works as well, as the game should re-create it due to the legacy scanning once you enter the end.)

Comment by Dolf Gulicher [ 07/Jan/17 ]

I restored to game to prior the mods earlier advised and went into creative mode.
I had to rebuild the portal 3 times, each time 1 level lower and eventually it spawned a new portal and was able to spawn the dragon.

I killed the dragon and the Endcity portal spawned. All entries in DragonFight are now correct.

Thank you very much for your advice and best wishes for the New Year.

Comment by RimaNari [ 08/Jan/17 ]

@Dolf Gulicher: Would you mind uploading your world anyways - in a state before you got the new portal to spawn? Strip the world of overworld and nether first though by removing the folders DIM and DIM-1 (only leaving DIM1) and if you explored a lot of the end already also delete all region files within DIM1 that have a number 2 or higher number in their file name. Then ZIP the world folder and attach it here.

Comment by Dolf Gulicher [ 08/Jan/17 ]

Happy to do that. However I don't have a DIM folder (there are DIM1 and DIM-1). There is another Region folder though.
Should I remove any files with a number of 2 of higher in their name?

Comment by RimaNari [ 08/Jan/17 ]

Ah, my bad, sorry. Delete the entire folders region and DIM-1, these store the data for overworld and nether, respectively. Folder DIM-1 contains the data from the End, so delete any files with a number 2 or higher in the filename from there to reduce overall file size. These will contain the outer end regions which should not interfere in any way with the issues of interest here. Thanks for making the effort

Comment by Dolf Gulicher [ 08/Jan/17 ]

Hope I did this correctly, if not let me know and I'll redo.

Thanks

Generated at Mon Oct 15 09:51:38 CDT 2018 using Jira 7.11.2#711002-sha1:fdc329dee91471a641faabfe39b5ff8c0a5b3f66.