Hey, this is my first thread, I hope im doing this right. So i'm not a new player in minecraft, I would say I'm pretty experienced, I've beaten the ender dragon twice, one on survival and one on hardcore. I start up a new world, and say "this is gonna be my permanent world", like a world that I would continue to work on and so forth. I create a nice house, get some iron and coal, leave the world to go check something with my texture pack. But then I come back and my iron, my coal, and my house were gone. Deleted. Never to be seen again! I'm pretty experienced with bugs myself, but I was baffled! So, I did some tests. I created a new world, placed down ONE SINGLE BLOCK. I left and rejoined and guess what? Its gone! back in the same place I broke it. So I try to re-install the launcher, see if that does anything. It did... For a while. I made a house, got some resources. Left the game and came back and it was all still there. I thought "Cool! It went away!". I build a wall, add some decoration, and do it again and guess what? My wall and decorations were all gone and it still took all my resources. Before I thought it was just an autosave bug but it took my resources... And deleted the walls and decorations. So I'm like "Thats it", I uninstall the minecraft launcher, the .minecraft folder, and use the Minecraft Launcher Installation Wizard to get a fresh copy. All works fine, it all works great, my progress doesn't get deleted. I did a few more tests to be sure, and I was right, it was over... For a day.
I thought it was all over, so I created a new world because My old one had a glitched trident drowned that I couldn't kill AND was invisible. I created a house, got some iron and coal once again. I leave the game to test my texture pack, in case i uploaded the wrong file (I did but thats off topic), come back and its all gone. my resources were taken, my house was gone. I'm at a loss now. I don't know what to do anymore. PLEASE GOD HELP ME OUT because NOBODY on the internet seems to have the same problem as me. I've checked for solutions online but all that comes up is "HoW tO rEcOvEr CoRuPpTeD wOrLdS". Please help me because I wish to play minecraft again!!!
If the game is encountering errors while saving or loading chunks you should be able to find them in the game output logs, located in .minecraft\logs (note that older logs are zipped); alternatively, enable the option to open a game output window (in launcher settings) while playing so you can catch errors as they happen.
The only thing "optimizing" (which would better be called "update"/"upgrade") does is update all chunks to the latest format at once, instead of as they are loaded while playing, to avoid lag (apparently the process is quite time-consuming; back in 1.2 they even had the game perform a mandatory full conversion when you loaded a world from an older version, nowadays they drastically change the save format with just about every major update so it is a good idea to "optimize" the world with each update). There is also an option to purge "cached data", which apparently refers to lighting and height maps, which have a tendency to become corrupted when updating (often due to bugs in the game itself; if you see odd behavior like sunlight underground or mobs spawning in lit areas it is a good idea to do this).