Skip to content

Automatic mod downloads from curseforge#57

Open
lockenkop wants to merge 9 commits intodeinfreu:mainfrom
lockenkop:main
Open

Automatic mod downloads from curseforge#57
lockenkop wants to merge 9 commits intodeinfreu:mainfrom
lockenkop:main

Conversation

@lockenkop
Copy link

@lockenkop lockenkop commented Jan 17, 2026

Hi, today my gaming buddies wanted to add mods to our dedicated server.
So i quickly wrote an automatic mod downloader.

The implementation is a bit crude and is most likely missing alot of best practices.

I just wanted to share it.

example compose

services:
  hytale:
    image: lockenkop18/hytale:experimental-alpine
    container_name: hytale-server
    environment:
      SERVER_IP: "0.0.0.0"
      SERVER_PORT: "5520"
      PROD: "FALSE"
      DEBUG: "FALSE"
      TZ: "Europe/Berlin"
      HYTALE_MODS: "1420179,1431645,1423634,1423289,1423494,1409811,1412197,1415079,1427562,1425945,1423183,1412200,1423307,1420446,1421380,1423445,1423443,1423203,1400317,1413286,1423288,1422910,1413287"
    restart: unless-stopped
    ports:
      - "5520:5520/udp"

The Curseforge (CF) Project IDs are looked up via https://cflookup.com/.
From there i get the latest release and the fileID.
crafting a valid CF CDN Download link from that, getting it and writing it to file int the mods folder.
If the file is a .jar the mod is completely installed.
If the file is a .zip the entrypoint.sh will extract all .zip archives it finds in the mods dir into the game dir.
This assumes the mod author adheres to the common zip file structure.

I tested this with the 20 most downloaded mods and it is working fine.

@deinfreu
Copy link
Owner

Thank you!

Going to take a look at it in 24hours.

@kalyano
Copy link

kalyano commented Jan 19, 2026

@deinfreu - any updates on bringing this in? would make it easy to get new mods

@lockenkop
Copy link
Author

I don't expect this to get merged soon. I much rather would not merge it in this state since it is very crude.

Although you can just use my forked alpine image to get the mods once and switch back to the stable one from deinfreu

lockenkop18/hytale:latest

@lockenkop
Copy link
Author

I have updated this to be more coherent with the project and put all the build steps into a builder stage.

If someon wants to check out the images i have uploaded them to my own dockerhub with your naming scheme

lockenkop18/hytale:experimental
lockenkop18/hytale:experimental-alpine
lockenkop18/hytale:experimental-alpine-liberica

There are some mods that fail to download. Curseforge is doing some funky things in their CDN paths. Most mods work though.

@deinfreu don't stress about handling this PR, i'd be happy to contribute but if this is not to your liking/ fitting into the project thats totally fine!

You also may steer me into a direction that would be more fitting.

@atti-exe
Copy link

This works great @lockenkop but just making others aware that when a mod gets updated (e.g. BetterMap/Vein) the old .jar file needs to be deleted otherwise it will prevent the Hytale server from booting due to duplicate plugins.

@lockenkop
Copy link
Author

Great catch.
I stumbled upon this yesterday too. I will have to support the deletion of old jar files.
I'm working on that.

@lockenkop
Copy link
Author

I have pushed a fix for that.
Since we download the mods latest release at every boot, we just clean all jars from the mods directory.
My Docker Images are updated aswell.

@shotah
Copy link

shotah commented Jan 23, 2026

I have pushed a fix for that. Since we download the mods latest release at every boot, we just clean all jars from the mods directory. My Docker Images are updated aswell.

Maybe some resistance here is Alpine is supposed to be small and secure, but we are loading it with Python. Not going to jump into any debates, but we already have the JVM on the image. Maybe look at building a Java app to run, or Go or Rust to build a compiled library to run on the image instead of loading up Python.

@shotah
Copy link

shotah commented Jan 24, 2026

I have pushed a fix for that. Since we download the mods latest release at every boot, we just clean all jars from the mods directory. My Docker Images are updated aswell.

See PR #73

Added a shell script as to not introduce additional dependencies. :)

@lockenkop
Copy link
Author

Maybe some resistance here is Alpine is supposed to be small and secure, but we are loading it with Python. Not going to jump into any debates, but we already have the JVM on the image. Maybe look at building a Java app to run, or Go or Rust to build a compiled library to run on the image instead of loading up Python.

Fair point. Your implementation in Bash is superior in this regard and i thought that the logic is not too complicated but i'm not as versed in bash, sed and regexes as you are. I couldn't write those without alot of AI help.

I haven't tested your implementation but it seems to keep close relation to my logic, so it should check out.

@deinfreu feel free to choose.

@shotah
Copy link

shotah commented Jan 24, 2026

Maybe some resistance here is Alpine is supposed to be small and secure, but we are loading it with Python. Not going to jump into any debates, but we already have the JVM on the image. Maybe look at building a Java app to run, or Go or Rust to build a compiled library to run on the image instead of loading up Python.

Fair point. Your implementation in Bash is superior in this regard and i thought that the logic is not too complicated but i'm not as versed in bash, sed and regexes as you are. I couldn't write those without alot of AI help.

I haven't tested your implementation but it seems to keep close relation to my logic, so it should check out.

@deinfreu feel free to choose.

@lockenkop I did the original implementation for itzg/minecraft-docker-container in '22. He has since moved it into Java, probably better that way.

As for this script, definitely some Claude in there. Could have I written it? yes, probably but I don't want to spend hours working on it. I just let it do the first pass and I validate it. Example it wanted to put mods in ./games/mods instead of ./mods. 🤷 But easy fixes and not wasting my night on re-writing old logic.

@shotah
Copy link

shotah commented Jan 24, 2026

@lockenkop also added #71 to enable pre-releases on the server. Getting excited for the stuff to come.

@shotah
Copy link

shotah commented Jan 24, 2026

@lockenkop I've forked and pushed the changes to my own deployment and credited deinfreu, I also added server jar checking because it wasn't getting updated properly.
https://github.com/shotah/hytale-server-container
https://hub.docker.com/repository/docker/shotah/hytale-server

🤷

@deinfreu
Copy link
Owner

@shotah @lockenkop Amazing work!

@shotah , would you be able to include the server JAR checking in PR #71 as well? I’m considering implementing the script-based approach for the auto mod downloader instead of the Python implementation, since Python would add another layer of complexity that I’d prefer to avoid. @lockenkop sorry.

@lockenkop
Copy link
Author

Sure as is said, it's the better option.

@shotah
Copy link

shotah commented Jan 26, 2026

@deinfreu sure, but I've added a lot to my fork: https://github.com/shotah/hytale-server-container

  • tests
  • merged docker file to use matrix deployments
  • added parameters
  • added permissions, whitelist, etc params.
  • updated readmes, and security

I can either cut one big PR or if you want to pick off the scripts you want.

GitHub
hytale-server-container 📦 56.4MB (Alpine/Liberica) • Non-root • QUIC Enabled • Prod & Debug • Pterodactyl coming - shotah/hytale-server-container

@dzatoah
Copy link
Contributor

dzatoah commented Jan 27, 2026

Just throwing this link in the circle for reference:
https://github.com/itzg/docker-minecraft-server/tree/fb1614b1492503bf9a3ce9ca77e6176cf3e76e8a/scripts

IMO, the environment variable names should be as close to the already established minecraft-server docker image as possible. :)

Also: it would be amazing if you could add examples how to use the feature.
Thanks for your alls work!

GitHub
Docker image that provides a Minecraft Server for Java Edition that automatically installs/upgrades versions, modloaders, modpacks and more at startup - itzg/docker-minecraft-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants