7

I was playing on my main world when my laptop ran out of power. I found a charger and woke it up, but Minecraft had crashed. Now, it doesn't appear in the world selection screen!

I have verified that it still exists in the Minecraft folder, and the directory contents look to be in order.

Does Minecraft save an internal flag somewhere when it crashes hard? If so, how do I reset it?

3
  • What are the contents of the save directory? Is it missing e.g. level.dat? If it is you may need to manually restore its contents, which may be tricky.
    – fredley
    Oct 11, 2011 at 22:37
  • 1
    @fredley level.dat is present and not empty. I'll have to get a closer look later, when I have access to my regular computer.
    – Maxpm
    Oct 13, 2011 at 17:20
  • 1
    Your file got probably corrupted because it didn't save correctly. I must say you're quite unlucky to have this happen. I did the same thing a few times, and never ended up losing a world. Unfortunately, I'm not very good at solving problems like these. I might do a bit of research and see what can be done tomorrow.
    – Quijibo
    May 16, 2019 at 19:21

5 Answers 5

7

This usually happens if the world is corrupted. There is no way to know what could be salvaged, but you can try the following:

  1. Delete or rename level.dat (it is corrupted and this is why it is not showing in the list of worlds).
  2. Rename level.dat_old (this is a backup file) to level.dat.
  3. Start Minecraft and see if the world appears. If yes, good on you.

If the above doesn't work it means the backup file is also corrupted. There is probably no way to recover:

  • world seed
  • world spawn and your player spawn (bed)
  • player location
  • player inventory

But usually the buildings are the most important part of the world and there is still more we can do to try to recover them! Try the following:

  1. Create a new world with the same name as the old one.
  2. Copy its level.dat file over the corrupted file.
  3. Start Minecraft (you will see both the old and the new worlds now) and open the old world. You'll probably appear in a different place (may even be inside a block). Look around to find your buildings.
  4. If all looks good and you want to continue playing in this world keep in mind that you'll have terrain generation boundaries, because the world seed is now different.
6

It sounds like something has got corrupted with your save file - to the extent that Minecraft no longer recognizes it. Your best solution is to restore from backup.

I'm taking it you don't have a backup, so the next best thing is to try and open it with another program, e.g. MCEdit, with which you can make some trivial edits and re-save, which may help restore your save file to an acceptable state. Note that MCEdit is not tied to your Minecraft save folder, you can manually load a map from any level.dat.

If this doesn't work (MCEdit won't open the file), you will have to sort things out manually. You'll need to look at the contents of your save file, and see where things could be going wrong. A good reference is the Java class that creates the save files. Good luck!

4

After a LOT of messing around with the save files, I found out a few things:

  • Minecraft does not detect a file that is just there without any data as a save file
  • The world will appear in-game only it it contains the level.dat file with certain data

    • There must be a Data storage with a version tag with the value 19133
  • You can have whatever other junk files you want there, I even tried creating files with names and data that made no sense, and it still worked

I managed to launch a world that looked like this:

srsly

It turned out to work as a brand new world.

So make sure your save file contains this data. I used NBTExplorer for accessing and editing the .dat file.

1

I have had this happen to me and I found a easy way to recover the world

Step 1: find out the seed. if you don’t know the seed use NBTExplorer Download: https://www.minecraftforum.net/forums/mapping-and-modding-java-edition/minecraft-tools/1262665-nbtexplorer-nbt-editor-for-windows-and-mac

Step 2: make a new world with the same seed and go back to the main menu

Step 3: go to saves folder in .minecraft and copy the region folder from the old world to the new and replace all files

Step 4: load the world up and boom your world is back

Step 5: (only if you want your inventory) go back to the saves folder and copy the playerdata Folder

And enjoy

-2

If the data isn't there, it doesn't exist. You could try file recovery tools like Revuva, but I doubt that that helps. The files were probably not saved at all, because your computer lagged too much for autosave or because of a different problem.

2
  • Well, first of all, the data IS there, as it is in the .minecraft folder. Minecraft saves data while running, so the data was probably also saved, so it's something like constant auto-saving. Also, the most likely problem is the file not being saved correctly and becoming corrupt.
    – Quijibo
    May 16, 2019 at 19:18
  • 1
    Oh, I misread the question, I thought he said it was NOT there. In that case I would recommend replacing parts of a functioning world one by one with parts of the broken world until it breaks, that way you know which part is responsible. And if it still works afterwards, it was just a missing file and you have a working world again now. May 17, 2019 at 4:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .