If I remove Minecraft sound files from .minecraft/assets/objects, will Minecraft be unable to play them?
In Minecraft, there are a lot of cool sounds. I decided to find there location and move them to my desktop. I have Ubuntu, and if when I remove them from that folder will Minecraft be unable to play them or is it smart enough to figure out that they are gone and download them again. Before minecraft was installed, it had to download the files. I even moved my favorite song (creative 6) from the sounds. The sounds are not labeled and have seemingly random names like b0b12118a97ddd733a50e9382e91a21652568641 and how will I know what to call them that will be recognized without digging through the index if Minecraft fails to download them? Or do I not have to worry because it will download them again upon launch?
Note: Why does it not label them and call them random names?
Solution 1:
There are three things that can happen if you delete a sound file from the assets folder, depending on when you do it:
- Before you start Minecraft: The launcher will download the missing file again and everything will behave normally.
- While Minecraft is running and after hearing that sound at least once: The sound is likely in RAM already and will be used from there. If you run out of RAM, it might be cleared, it might not.
- While Minecraft is running and before hearing the sound for the first time: It will likely not be in RAM, so Minecraft will actually try to access the missing file. What happens then? It freezes. Not really what you want.
What to do?
You likely want to mute a sound. You can do that by creating a resource pack (archive) that replaces the sound with a silent sound file. Since it's surprisingly difficult to get one of those, I made one a long time ago: silent.ogg*
Why the weird names?
The files names are SHA-256 (archive) hashes of the file contents, which in short means that Minecraft can very quickly check whether it already has a file or needs to still download it.
If you want to get the proper names, there is an index in .minecraft/assets/indexes/<version>.json
.
It uses the syntax: "<proper_filename>":{"hash":"<hash_filename>","size":"<file_size>"}
<hash_filename>
is the filename as it appears in .minecraft/assets/objects
, <proper_filename>
is a humanly readable file name.
Note that only files in .minecraft/assets/objects
are listed here, other assets, for example textures, are contained in the .jar
files in .minecraft/versions
. They have proper filenames themselves.
(*That file is on my Google Drive. It should stay there, but if it's ever not available anymore, send me a mail, it will be in my October 2018 backup.)