The bug
While testing MC-30646 "Hardcore game is not deleted" I found what may be another manifestation of the same bug, or maybe a new bug (perhaps related to MC-526 "Worlds will not delete").
Not only does a hardcore world not delete with the hardcore death screen deletion button (MC-30646), but additionally the world continues to run behind the UI. You get dropped to the title screen, but can hear the game sounds and music. You can also see the world still running on a second deletion confirmation screen. And even after the apparently successful second deletion action, the world is still not deleted.
How to reproduce
Create singleplayer hardcore world
Die in your hardcore world
Choose "Delete world" on the death screen (not "Spectate world")
Get dropped back to title screen
→ Notice the game sounds continue, as if your world is still runningChoose singleplayer and view list of worlds
→ Observe that the hardcore world is not deleted, as per MC-30646Highlight hardcore world and choose delete
On confirmation screen ("forever is a long time!"), confirm deletion
→ Notice that you can see your world still running in the background here, as well as hear it. Instead of the expected dirt texture backgroundGet dropped back to singleplayer world list
→ Observe that hardcore world is not on the list, indicating (apparently) that it was deleted successfully.Hit escape (don't click the cancel button with mouse cursor)
Expected result
Go to title screen. Hardcore world remains deleted.
Actual result
Get kicked back into your hardcore world, facing once again the choice to delete or spectate. The first time I arrived here, I chose to spectate and my world was full of chunks that wouldn't load, and the game crashed with a memory overflow shortly, indicating maybe some part of the deletion was successful. On subsequent attempts, spectator mode worked fine, with no crashes, in the supposedly deleted world. Hitting delete at this screen will repeat the loop without deleting the world.
Note that hitting the escape key on the world select screen should probably behave the same as clicking the cancel button. That they behave differently may be another bug.
Note
Code analysis can be found in this comment
Related issues
is duplicated by
Attachments
Comments


Can confirm.
EDIT: Apparently, after the world is "Deleted", the area that you died in said world shows up in various menus.

Confirmed for 16w05b.

Confirmed 16w07a.

@unknown, since you're the reporter of this ticket, you can update the affected versions list by yourself (and you don't need to leave a comment "Confirmed XXYY")

Thanks for pointing that out, Kumasasa. I'm kinda slow. But I've updated it to show 1.9-pre1 now.

I accidentally made a dupe of this in MC-98939. It appears that the world is still loaded in memory and running and so you can't completely delete it until you exit out of minecraft.

Confirmed for 1.13.1.

I seem to have found the source of the issue.
To sum it up, inside of GuiGameOver.java when the game checks if the world was in hardcore, it only changes the GuiScreen to the Main Menu without sending the normal disconnect packet.
Specifically in the actionPreformed function of GuiGameOver.java the if statement
if (this.mc.world.getWorldInfo().isHardcoreModeEnabled()) {
this.mc.displayGuiScreen(new GuiMainMenu());
}
should more closely mirror the functionality of the confirmClicked function (where result is a boolean that is true if the player clicked "Title Screen" after dying).
if (result) {
if (this.mc.world != null) {
this.mc.world.sendQuittingDisconnectingPacket();
}
this.mc.loadWorld((WorldClient)null);
this.mc.displayGuiScreen(new GuiMainMenu());
}
The fixed code is the following (for actionPerformed in GuiGameOver.java ~line 75)
if (this.mc.world.getWorldInfo().isHardcoreModeEnabled()) {
//Changed
if (this.mc.world != null) {
this.mc.world.sendQuittingDisconnectingPacket();
}
this.mc.loadWorld((WorldClient)null);
//
this.mc.displayGuiScreen(new GuiMainMenu());
}
This issue can have severe consequence when trying to rejoin the world in the background after hitting "delete world", it will freeze the game.

When "Delete World" is pressed, you are sent to the menu which has a white screen (white-menu-background.png) [MC-148865]. If you try and Edit the world's options, it will overlay the in-game events (edit-world-options.png). If you try to join the Hardcore world you just left the screen will go black and the game will be completely unresponsive (rejoin-hardcore-world.png).

Being unable to delete world 1.14.3 pre 4 confirmed. Can't delete it from the saves menu or windows explorer either. And you don't have to die to be unable to delete hardcore worlds.

Still confirmed for 1.14.4 release

Issue is still existing in 1.14.4
Screen is from me trying enter that type of world 😛
Game is still running

Fix to this issue in 1.14.4 is simple:
Tested on custom MCP 1.14.4
In `confirmCallback` after sending packet of disconnecting
SaveFormat saveformat = this.minecraft.getSaveLoader();
for (WorldSummary worldSummary : WorldSelectionList.field_212331_y) {
if (this.minecraft.player.world.getWorldInfo().getWorldName() == worldSummary.getDisplayName()) {
saveformat.deleteWorldDirectory(worldSummary.getFileName());
}
}
and in button action add code below before function displaying main menu
this.confirmCallback(true);
@edit
forgot to mention about changeing access for
private List<WorldSummary> field_212331_y;
from `private` to `public static`

Yeah that happened to me once too. Also, did anyone else who got this bug have a tough time ending the Minecraft Java Program? I had a tough time stopping the game.

Was fixed in 19w35a, see MC-30646 for details.