Skip to content

Conversation

@MaxPtg
Copy link

@MaxPtg MaxPtg commented Sep 19, 2025

Description

The FTB API has changed and as such, the current egg does not work correctly. I have done the following to fix this:

  • Improve the startup script to be more robust and implemented better error handling
  • Change the startup command to work with the new neoforge versions
  • Update the README with examples on how to fill the variables within the Panel

I am aware that there already is a PR that is supposed to fix this but it didn't work for me without additional changes and it seems to be abandoned. As a result, I tried fixing it myself.

This updated Egg has been tested with the following modpacks on Pelican + Pterodactyl:

  • FTB Evolution (IDs & Name+Version-String)
  • FTB Revelation (IDs & Name+Version-String)
  • FTB Skies (IDs & Name+Version-String)
  • FTB Skies 2 (IDs & Name+Version-String)

I am not sure about the Log4J fixes. Some of the older modpacks with older Java versions still download the Log4J fix jar but the new ones do not. The problem is that if the jar is not downloaded (on newer packs), the startup command won't work correctly. Not sure how to handle this. I'd suggest a startup script that checks if the jar exists and adjusts the startup command accordingly.

Checklist for all submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you tested and reviewed your changes with confidence that everything works?
  • Did you branch your changes and PR from that branch and not from your master branch?
    • If not, why?:
  • You verify that the start command applied does not use a shell script
    • If some script is needed then it is part of a current yolk or a PR to add one
  • The egg was exported from the panel

@MaxPtg MaxPtg changed the title Fix/ftb egg Fix for the Minecraft FTB Egg Sep 19, 2025
@MaxPtg MaxPtg marked this pull request as ready for review September 19, 2025 15:21
@MaxPtg MaxPtg requested a review from gOOvER September 19, 2025 16:38
Copy link
Contributor

@parkervcp parkervcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MaxPtg You want to make this change for both eggs.

"scripts": {
"installation": {
"script": "#!/bin/bash\r\n# FTB Modpack Installation Script\r\n\r\nset -e\r\n\r\n#\r\nreadonly SERVERFILE_DIR=\"/mnt/server\"\r\nreadonly FTB_API_URL=\"https://api.feed-the-beast.com/v1/modpacks/public/modpack\"\r\n\r\n# Ensure server directory exists\r\nmkdir -p \"${SERVERFILE_DIR}\"\r\ncd \"${SERVERFILE_DIR}\"\r\n\r\necho \"Starting FTB modpack installation...\"\r\n\r\n# Install required dependencies\r\ninstall_dependencies() {\r\n echo \"Installing dependencies...\"\r\n apt-get update -qq\r\n apt-get install -y curl jq\r\n}\r\n\r\n# URL encode function for search terms\r\nurl_encode() {\r\n local string=\"${1// /%20}\"\r\n echo \"$string\"\r\n}\r\n\r\n# Resolve modpack ID from search term\r\nresolve_modpack_id() {\r\n if [[ -z \"${FTB_MODPACK_ID}\" && -n \"${FTB_SEARCH_TERM}\" ]]; then\r\n echo \"Resolving modpack ID from search term: ${FTB_SEARCH_TERM}\"\r\n local encoded_term=$(url_encode \"$FTB_SEARCH_TERM\")\r\n local search_url=\"https://api.modpacks.ch/public/modpack/search/8?term=${encoded_term}\"\r\n \r\n FTB_MODPACK_ID=$(curl -sSL \"$search_url\" | jq -r \".packs[0]\")\r\n \r\n if [[ \"${FTB_MODPACK_ID}\" == \"null\" || -z \"${FTB_MODPACK_ID}\" ]]; then\r\n echo \"Error: Could not find modpack with search term '${FTB_SEARCH_TERM}'\"\r\n exit 1\r\n fi\r\n \r\n echo \"Found modpack ID: ${FTB_MODPACK_ID}\"\r\n fi\r\n}\r\n\r\n# Resolve version ID from version string\r\nresolve_version_id() {\r\n if [[ -z \"${FTB_MODPACK_VERSION_ID}\" && -n \"${FTB_VERSION_STRING}\" ]]; then\r\n echo \"Resolving version ID from version string: ${FTB_VERSION_STRING}\"\r\n \r\n local api_url=\"${FTB_API_URL}/${FTB_MODPACK_ID}\"\r\n local api_data=$(curl -sSL \"$api_url\" 2>/dev/null || echo \"null\")\r\n \r\n if [[ \"$api_data\" != \"null\" ]] && echo \"$api_data\" | jq -e '.status == \"success\"' >/dev/null 2>&1; then\r\n FTB_MODPACK_VERSION_ID=$(echo \"$api_data\" | jq -r --arg version \"${FTB_VERSION_STRING}\" '.versions[] | select(.name == $version) | .id')\r\n fi\r\n \r\n if [[ \"${FTB_MODPACK_VERSION_ID}\" == \"null\" || -z \"${FTB_MODPACK_VERSION_ID}\" ]]; then\r\n echo \"Error: Could not find version '${FTB_VERSION_STRING}' for modpack ID ${FTB_MODPACK_ID}\"\r\n exit 1\r\n fi\r\n \r\n echo \"Found version ID: ${FTB_MODPACK_VERSION_ID}\"\r\n fi\r\n}\r\n\r\n# Download and execute modpack installer\r\ninstall_modpack() {\r\n local installer_arch=$([ \"$(uname -m)\" == \"x86_64\" ] && echo \"linux\" || echo \"arm/linux\")\r\n \r\n echo \"Installing modpack...\"\r\n echo \"Modpack ID: ${FTB_MODPACK_ID}\"\r\n echo \"Version ID: ${FTB_MODPACK_VERSION_ID}\"\r\n echo \"Architecture: ${installer_arch}\"\r\n \r\n # Clean up old forge/neoforge files\r\n rm -rf libraries/net/minecraftforge/forge\r\n rm -rf libraries/net/neoforged/forge\r\n rm -f unix_args.txt\r\n \r\n # Download and run installer using FTB API\r\n local api_url=\"${FTB_API_URL}/${FTB_MODPACK_ID}/${FTB_MODPACK_VERSION_ID}/server/${installer_arch}\"\r\n local http_code=$(curl -o /dev/null -s -w \"%{http_code}\" \"$api_url\")\r\n \r\n if [[ \"$http_code\" == \"200\" ]]; then\r\n echo \"Downloading installer from FTB API\"\r\n curl -L \"$api_url\" --output serversetup\r\n chmod +x ./serversetup\r\n ./serversetup -pack \"${FTB_MODPACK_ID}\" -version \"${FTB_MODPACK_VERSION_ID}\" -auto -force\r\n else\r\n echo \"Error: FTB API returned HTTP $http_code for installer download\"\r\n echo \"URL: $api_url\"\r\n exit 1\r\n fi\r\n}\r\n\r\n# Setup startup files and symlinks for Pelican Panel startup command\r\nsetup_startup_files() {\r\n echo \"Setting up startup files...\"\r\n \r\n # Create symlinks for unix_args.txt (priority order)\r\n for path in \"libraries/net/minecraftforge/forge/*/unix_args.txt\" \\\r\n \"libraries/net/neoforged/neoforge/*/unix_args.txt\" \\\r\n \"libraries/net/fabricmc/fabric-loader/*/unix_args.txt\"; do\r\n if compgen -G \"$path\" >/dev/null; then\r\n ln -sf $path unix_args.txt\r\n break\r\n fi\r\n done\r\n \r\n # Move modloader jar to standard name (priority order)\r\n for pattern in \"forge-*.jar\" \"neoforge-*.jar\" \"fabric-*.jar\"; do\r\n if compgen -G \"$pattern\" >/dev/null; then\r\n mv $pattern start-server.jar\r\n break\r\n fi\r\n done\r\n}\r\n\r\n# Clean up installation files\r\ncleanup_installation() {\r\n echo \"Cleaning up installation files...\"\r\n rm -f serversetup run.bat\r\n}\r\n\r\n# Main installation flow\r\nmain() {\r\n echo \"=== FTB Modpack Installation ===\"\r\n echo \"Modpack ID: ${FTB_MODPACK_ID:-'(to be resolved)'}\"\r\n echo \"Version ID: ${FTB_MODPACK_VERSION_ID:-'(to be resolved)'}\"\r\n echo \"Search Term: ${FTB_SEARCH_TERM:-'(not set)'}\"\r\n echo \"Version String: ${FTB_VERSION_STRING:-'(not set)'}\"\r\n echo \"================================\"\r\n \r\n install_dependencies\r\n resolve_modpack_id\r\n resolve_version_id\r\n install_modpack\r\n setup_startup_files\r\n cleanup_installation\r\n \r\n echo \"=== Installation Complete ===\"\r\n}\r\n\r\n# Execute main function\r\nmain",
"container": "openjdk:8-jdk-slim",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry it's taken so long to look at this.

We need to update the install images because the openjdk images were removed.

You can use ghcr.io/pelican-eggs/installers:java_8

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.

4 participants