7

I'm making a resource pack editor for Minecraft in python. It needs to access the versions folder of Minecraft, but I need to know if, once inside the Minecraft folder, the structure is the same on all platforms, ex. the versions folder is always versions/, the resource packs folder is always resourcepacks/, or if it's different on every platform.

I know the location of the Minecraft folder is different on every platform, but what I want to know is if the location of the folders inside the Minecraft folder change.

9

Short answer: Yes, the contents of the folder will be the same

Long answer: Yes, however the location differs. If you're using python, you can use the sys.platform() function to get that data. Typically, the default locations are:

  • Windows: %appdata%/.minecraft
  • MacOS (darwin): $HOME/Library/Application Support/minecraft
  • Linux: $HOME/.minecraft

It might also be useful to allow the user to choose a custom .minecraft path if they're using a custom launcher.

Edit: According to this stackoverflow question, you should try to use platform.system() for a more consistent output

2
  • Thanks! But can python open files in Windows if I just put in, for example, %appdata%/.minecraft/versions/1.17.1/1.17.1.jar as the path? Or do I need to pass it through some function like os.path.expanduser() or os.path.absolutepath()?
    – LuisAFK
    Oct 12 at 17:19
  • 2
    You should be able to use either os.getenv('APPDATA') or os.path.expandvars(r'%appdata%\.minecraft\path\to\foo')
    – Ben
    Oct 12 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.