Egg Repository

Pterodactyl Community Egg Repository

FTB Server

FTB modpacks are now distributed through their own API. This egg was developed for support for modpacks that are distributed through this.

Read Me

FTB Modpacks

A generic service to pull FTB modpacks from api.feed-the-beast.com. There are 2 ways to install a server through this service. The first method only requires you to know the modpacks name and (optionally) version. The second method requires you to know the id for the modpack and (optionally) version in the api.

Method 1 (Recommended)

  • FTB_SEARCH_TERM: the modpack name to query for, must be at least 3 characters long. EX: for FTB: Interactions you would do "interactions".
  • FTB_VERSION_STRING: the string version that you want to install. Leave blank to install latest stable release. EX: for FTB: Interactions 2.0.2, you would put "2.0.2".

Method 2

  • FTB_MODPACK_ID: the id that directs to the modpack in the api. EX: for FTB: Interactions the id would be "5". https://api.feed-the-beast.com/v1/modpacks/public/modpack/5
  • FTB_MODPACK_VERSION_ID: the version id in the api. Leave blank to install latest stable release. EX: for FTB: Interactions 2.0.2 the id is "86". https://api.feed-the-beast.com/v1/modpacks/public/modpack/5/86

NOTE Not all FTB packs come with a server.properties file, due to this the server.properties file may not get updated with the correct ip address and port at first launch. Please restart the server after first launch to fix this.

Neoforged

If you have trouble using an neoforge pack, make sure to select the latest java.

Server Ports

The minecraft server requires a single port for access (default 25565) but plugins may require extra ports to enabled for the server.

Port default
Game 25565
Yolks
NameTag
Java 8ghcr.io/ptero-eggs/yolks:java_8
Java 11ghcr.io/ptero-eggs/yolks:java_11
Java 16ghcr.io/ptero-eggs/yolks:java_16
Java 17ghcr.io/ptero-eggs/yolks:java_17
java 21ghcr.io/ptero-eggs/yolks:java_21
java 22ghcr.io/ptero-eggs/yolks:java_22
Variables
NameDescriptionEnvironment VariableDefault ValueUser ViewableUser Editable
FTB Pack search termthe search term for finding the modpack. needs to be at least 4 characters long. Find out what term is needed by using the ftb app and searching with the term. make sure it only returns 1 result. can also be searched for via: https://api.feed-the-beast.com/v1/modpacks/public/modpack/search/8?term={SEARCHTERM} only needed if the modpack id and modpack version id is unknown.FTB_SEARCH_TERMYesYes
FTB modpack IDThe FTB Api modpack ID. Needed if not using the search variable Example: FTB Interactions ID is 5. https://api.feed-the-beast.com/v1/modpacks/public/modpack/5FTB_MODPACK_IDYesYes
FTB Pack Versionwhat version of the modpack to install. leave empty if using the modpack version id variable.FTB_VERSION_STRINGYesYes
FTB Pack Version IDThe modpack api version ID. Leave this and FTB Pack Version empty to install latest. Example FTB Revelations version id for version "2.0.2" is 86. which would come out as: https://api.feed-the-beast.com/v1/modpacks/public/modpack/5/86FTB_MODPACK_VERSION_IDYesYes
Install Script
#!/bin/bash
# FTB Pack Installation Script
#
# Server Files: /mnt/server
if [ ! -d /mnt/server ]; then
    mkdir -p /mnt/server
fi
cd /mnt/server || { echo "Failed to change into server directory"; exit 1; }


# Download needed software.
function install_required {
    apt update
    apt install -y curl jq
}

function get_modpack_id {
    urlencode() {
        local string="${1// /%20}"
        echo "$string"
    }
    
    # if no modpack id is set and modpack search term is set.
    if [ -z "${FTB_MODPACK_ID}" ] && [ -n "${FTB_SEARCH_TERM}" ]; then
        encoded_search_term=$(urlencode "$FTB_SEARCH_TERM")
        JSON_DATA=$(curl -sSL https://api.feed-the-beast.com/v1/modpacks/public/modpack/search/8?term="${encoded_search_term}")
    
        # grabs the first modpack in array.
        FTB_MODPACK_ID=$(echo -e "${JSON_DATA}" | jq -r ".packs[0]")
    fi
    
    if [ -z "${FTB_MODPACK_VERSION_ID}" ] && [ -n "${FTB_VERSION_STRING}" ]; then
        # grabs the correct version id matching the string.
        FTB_MODPACK_VERSION_ID=$(curl -sSL https://api.feed-the-beast.com/v1/modpacks/public/modpack/"${FTB_MODPACK_ID}" | jq -r --arg VSTRING "${FTB_VERSION_STRING}" '.versions[] | select(.name == $VSTRING) | .id')
    fi
}

function run_installer {
    # get architecture for installer
    INSTALLER_TYPE=$([ "$(uname -m)" == "x86_64" ] && echo "linux" || echo "arm/linux")
    echo "ModpackID: ${FTB_MODPACK_ID} VersionID: ${FTB_MODPACK_VERSION_ID:-latest} InstallerType: ${INSTALLER_TYPE}"

    # download installer
    curl -Ls https://api.feed-the-beast.com/v1/modpacks/public/modpack/0/0/server/${INSTALLER_TYPE} --output serversetup
    chmod +x ./serversetup
    
    # remove old forge files (to allow updating)
    rm -rf libraries/net/minecraftforge/forge
    rm -rf libraries/net/neoforged/forge
    rm -f unix_args.txt
    
    # run installer
    # shellcheck disable=SC2046
    ./serversetup -pack "${FTB_MODPACK_ID}" $([ -n "$FTB_MODPACK_VERSION_ID" ] && echo "-version $FTB_MODPACK_VERSION_ID") -no-colours -no-java -auto -force || { echo "Failed to run FTB Installer"; exit 1; }
}

# allows startup command to work
function move_startup_files {
    # create symlink for forge unix_args.txt if exists
    if compgen -G "libraries/net/minecraftforge/forge/*/unix_args.txt"; then
        ln -sf libraries/net/minecraftforge/forge/*/unix_args.txt unix_args.txt
    fi
    
    # create symlink for neoforge unix_args.txt if exists
    if compgen -G "libraries/net/neoforged/forge/*/unix_args.txt"; then
        ln -sf libraries/net/neoforged/forge/*/unix_args.txt unix_args.txt
    fi
    
    # move forge/neoforge/fabric jar file to start-server.jar if exists
    if compgen -G "forge-*.jar"; then
        mv -f forge-*.jar start-server.jar
    elif compgen -G "fabric-*.jar"; then
        mv -f fabric-*.jar start-server.jar
    fi
}

# installer cleanup
function installer_cleanup {
    rm serversetup
    rm -f run.bat
    rm -f run.sh
}

# run installation steps
install_required
get_modpack_id
run_installer
move_startup_files
installer_cleanup

echo "Finished installing FTB modpack"