The bug
If an integrated / multiplayer server gets forcibly or unexpectedly closed (due to a crash / PC shutdown / OS update - Windows in particular) the world data gets corrupted.
Potential corruptions / damage:
Unreadable region files (chunk, block, entity data)
Level.dat (general data about the world and player data in singleplayer)
Unrecoverable player data in multiplayer (resulting in complete overwrite of the files at the next start)
Chunk saving errors when the server tries to save the world after the corruption
[14:06:37] [Server thread/WARN]: Failed to load player data for VideoklipBG
[14:06:37] [Server thread/INFO]: VideoklipBG[/192.168.0.180:50321] logged in with entity id 196 at (101.5, 67.0, -117.5)
[14:06:37] [Server thread/INFO]: VideoklipBG joined the game
[14:06:54] [File IO Thread/ERROR]: Failed to save chunk
java.lang.IndexOutOfBoundsException: Index: 811, Size: 805
at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_181]
at java.util.ArrayList.set(Unknown Source) ~[?:1.8.0_181]
at bnw.a(SourceFile:304) ~[server_18w31a.jar:?]
at bnw$a.close(SourceFile:279) ~[server_18w31a.jar:?]
at java.util.zip.DeflaterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at bns.a(SourceFile:270) [server_18w31a.jar:?]
at cdt.c(SourceFile:44) [server_18w31a.jar:?]
at cdt.run(SourceFile:35) [server_18w31a.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
[14:07:25] [Server thread/INFO]: [VideoklipBG: Saved the game]
[14:07:28] [Server thread/ERROR]: Failed to save chunk
java.lang.IndexOutOfBoundsException: Index: 807, Size: 805
at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_181]
at java.util.ArrayList.set(Unknown Source) ~[?:1.8.0_181]
at bnw.a(SourceFile:304) ~[server_18w31a.jar:?]
at bnw$a.close(SourceFile:279) ~[server_18w31a.jar:?]
at java.util.zip.DeflaterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at bns.a(SourceFile:270) ~[server_18w31a.jar:?]
at bns.b(SourceFile:296) ~[server_18w31a.jar:?]
at td.c(SourceFile:235) ~[server_18w31a.jar:?]
at te.u(SourceFile:746) ~[server_18w31a.jar:?]
at rk.a(SourceFile:60) ~[server_18w31a.jar:?]
at rk.a(SourceFile:39) ~[server_18w31a.jar:?]
at rk.a(SourceFile:25) ~[server_18w31a.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:132) ~[server_18w31a.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:72) ~[server_18w31a.jar:?]
at bv.a(SourceFile:205) ~[server_18w31a.jar:?]
at ud.c(SourceFile:1075) ~[server_18w31a.jar:?]
at ud.a(SourceFile:1062) ~[server_18w31a.jar:?]
at mi.a(SourceFile:37) ~[server_18w31a.jar:?]
at mi.a(SourceFile:9) ~[server_18w31a.jar:?]
at iy.a(SourceFile:10) ~[server_18w31a.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181]
at k.a(SourceFile:199) [server_18w31a.jar:?]
at net.minecraft.server.MinecraftServer.b(SourceFile:726) [server_18w31a.jar:?]
at sp.b(SourceFile:360) [server_18w31a.jar:?]
at net.minecraft.server.MinecraftServer.a(SourceFile:681) [server_18w31a.jar:?]
at net.minecraft.server.MinecraftServer.run(SourceFile:584) [server_18w31a.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
[14:07:28] [Server thread/ERROR]: Failed to save chunk
java.lang.IndexOutOfBoundsException: Index: 811, Size: 805
at java.util.ArrayList.rangeCheck(Unknown Source) ~[?:1.8.0_181]
at java.util.ArrayList.set(Unknown Source) ~[?:1.8.0_181]
at bnw.a(SourceFile:304) ~[server_18w31a.jar:?]
at bnw$a.close(SourceFile:279) ~[server_18w31a.jar:?]
at java.util.zip.DeflaterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at java.io.FilterOutputStream.close(Unknown Source) ~[?:1.8.0_181]
at bns.a(SourceFile:270) ~[server_18w31a.jar:?]
at bns.b(SourceFile:296) ~[server_18w31a.jar:?]
at td.c(SourceFile:235) ~[server_18w31a.jar:?]
at te.u(SourceFile:746) ~[server_18w31a.jar:?]
at rk.a(SourceFile:60) ~[server_18w31a.jar:?]
at rk.a(SourceFile:39) ~[server_18w31a.jar:?]
at rk.a(SourceFile:25) ~[server_18w31a.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:132) ~[server_18w31a.jar:?]
at com.mojang.brigadier.CommandDispatcher.execute(CommandDispatcher.java:72) ~[server_18w31a.jar:?]
at bv.a(SourceFile:205) ~[server_18w31a.jar:?]
at ud.c(SourceFile:1075) ~[server_18w31a.jar:?]
at ud.a(SourceFile:1062) ~[server_18w31a.jar:?]
at mi.a(SourceFile:37) ~[server_18w31a.jar:?]
at mi.a(SourceFile:9) ~[server_18w31a.jar:?]
at iy.a(SourceFile:10) ~[server_18w31a.jar:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_181]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_181]
at k.a(SourceFile:199) [server_18w31a.jar:?]
at net.minecraft.server.MinecraftServer.b(SourceFile:726) [server_18w31a.jar:?]
at sp.b(SourceFile:360) [server_18w31a.jar:?]
at net.minecraft.server.MinecraftServer.a(SourceFile:681) [server_18w31a.jar:?]
at net.minecraft.server.MinecraftServer.run(SourceFile:584) [server_18w31a.jar:?]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_181]
Related issues
is duplicated by
Comments


There are ways of coding that prevent corruption of files in such manner.

@unknown Do you have any objections if I change myself to the reporter, to keep it more up to date? (I experience this every day due to windows attempting to update every time.)

[Mod] FVbico (Steven Verberne) Oh, I thought this was an old, closed issue and I haven't updated / changed anything here, beacause it was tagged as invalid? I have nothing against that, go ahead if you want to own and update this ticket.
Actually I have created it, because a long time ago some the 1.8 verisons (1.8 - 1.8.9) and behind (1.7.10 and previous) when the Server is force-closed, killed or the process is tereminaed in some way (OS crash, Machine power off due to power outage, etc.) all the files were fine, nothing corrupted, rolled-back couple seconds, everything was saved how it's supposed to be.
From 1.9 + (I think) almost all data is corrupted in some way and regenerated on the next start. (Spawn chunks, Last loaded chunks, All player data, Stats, Info about the other dimensions and structures and many more, including "level.dat")

It was resolved as invalid for a wrong reason; I reopened it when I found it.

Well, thank you for the "support" on this issue. I'm sure that isn't supposed to be like that and there's definetly some issue with the code or it's just poorly designed.

Affects all 18w snapshots as well as the current pre-release - 1.13-pre3.

Can confirm for 1.13-pre6, including the previous few pre-releases.

this happened to me a few times, but i didn't force close the window, i was just playing with phantoms and the game crashed, when i went back on, the world disappeared from the worlds list. Minecraft is very poorly and horribly coded in terms of saving data. Not too long ago, i had chunks that loaded in buildings i SAVED.

@Calvin Zachary Stasica
No, Minecraft is not horribly coded in terms of saving. It is much more efficient than many other games of its type. A crash will always revert your world by some amount, and there's no good way around it. Also, the client may purposefully revert a small amount of time to leave time before the event that caused the crash occurs again if it is a set event. The corruption is a fixable issue that will likely be resolved in the next pre-release or update, but crashes will always have consequences.

think this has happened to me twice.

Confirmed for 20w15a.

Sometimes this even reset my statistics

I am at a complete loss as what to do. Last night I was playing Minecraft on Survival Peaceful Mode when we lost our electricity. All the power went out in our town and was not restored for several hours later. Today, when I logged in Minecraft, I went to my world (still listed as usual) and started puttering around in my castle and front gardens. I went to the back to bring stuff to the local village which is in sight and everything was messed up. Holes are everywhere, the homes of the villagers and the villagers themselves are ruined or missing, red soil from the badlands suddenly showed up in my desert, blotches of the landscape is all messed up and moved around. My world is ruined. After all my hard work and time devoted to it. I don't know how to fix this. Please help!

It already happened. It cannot be fixed. I would say to backup your world daily in the future. So if anything is lost, it is just a day.

Can confirm for Minecraft 1.20
If you close an application without giving it any time to finish what it's doing (e. g. power outage, kill via task manager), it's inevitable that things will break. In your case, it seems that Minecraft was in the middle of writing the <player>.dat file when you force closed it. The next time you started it, Minecraft detected that the file was invalid and ignored it, generating a new blank one instead.