Skip to content

FTB Server

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

egg-ftb-server.json

updated

Ports

Add an allocation on the node for each port.

  • Game 25565

Install

Installer image
eclipse-temurin:8-jdk-jammy
Install script
103 lines

Images

New servers use the first image. Users can change it on the Startup page.

  • Java 8 default ghcr.io/ptero-eggs/yolks:java_8
  • Java 11 ghcr.io/ptero-eggs/yolks:java_11
  • Java 16 ghcr.io/ptero-eggs/yolks:java_16
  • Java 17 ghcr.io/ptero-eggs/yolks:java_17
  • Java 21 ghcr.io/ptero-eggs/yolks:java_21
  • Java 22 ghcr.io/ptero-eggs/yolks:java_22
  • Java 23 ghcr.io/ptero-eggs/yolks:java_23
  • Java 24 ghcr.io/ptero-eggs/yolks:java_24
  • Java 25 ghcr.io/ptero-eggs/yolks:java_25

Panel features

  • eula

    The Panel asks the user to accept the Minecraft EULA when the server needs it.

  • java_version

    The Panel lets the user change the Java version when the server needs a different one.

  • pid_limit

    The Panel tells the user when the server reaches its process or memory limit.

Startup

The Panel runs this command to start the server. It replaces each variable in the command with the value of that variable.

4 variables

Startup command

java $( [[ -f log4jfix/Log4jPatcher.jar ]] && printf %s "-javaagent:log4jfix/Log4jPatcher.jar " ) -Xms128M -XX:MaxRAMPercentage=95.0 -Dterminal.jline=false -Dterminal.ansi=true $( [[ ! -f unix_args.txt ]] && printf %s "-jar start-server.jar" || printf %s "@unix_args.txt" )
  • the 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_TERMUsers can edit

    nullable|string

  • The 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/5

    FTB_MODPACK_IDUsers can edit

    nullable|integer

  • what version of the modpack to install. leave empty if using the modpack version id variable.

    FTB_VERSION_STRINGUsers can edit

    nullable|string

  • The 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/86

    FTB_MODPACK_VERSION_IDUsers can edit

    nullable|integer

Wings

Stop command
stop
Running when the console shows
)! For help, type

Files Wings edits

Wings sets these values in these files before each start.

server.properties properties

server-ip
0.0.0.0
server-port
{{server.build.default.port}}
query.port
{{server.build.default.port}}

Readme

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

Changes

  1. Adding java 25 to most minecraft eggs

    · Red-Banana-Official · fb0c032

  2. Move more eggs off deprecated openjdk images

    · Daniel Barton · a140ad1

  3. FTB: Fix reinstallation of newer versions of neoforge (#162)

    · Daniel Barton · 3f679e1

  4. FTB: Handle new unix_args.txt location and handle log4jfix

    · Daniel Barton · 3cc7ff2

  5. Update FTB egg to use new FTB api (#56)

    · Daniel Barton · 42e1507

All changes on GitHub

Problem with this egg?

Open an issue on GitHub. Include your Panel and Wings versions.

Install script 103 lines bash in eclipse-temurin:8-jdk-jammy Show
#!/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 -rf libraries/net/neoforged/neoforge
    rm -f unix_args.txt
    
    # Remove old log4jpatcher
    rm -rf log4jfix/
    
    # 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
    if compgen -G "libraries/net/neoforged/neoforge/*/unix_args.txt"; then
        ln -sf libraries/net/neoforged/neoforge/*/unix_args.txt unix_args.txt
    fi
    
    # Create symlink for log4jpatcher that is sometimes included
    if compgen -G "log4jfix/Log4jPatcher-*.jar"; then
        ln -sf log4jfix/Log4jPatcher-*.jar log4jfix/Log4jPatcher.jar
    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"