Egg Repository

Pterodactyl Community Egg Repository

tModloader

tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure "intricacies" of Terraria's source code. It is made to work for Terraria 1.3+.

Read Me

tModLoader

From their GitHub

tModLoader is essentially a mod that provides a way to load your own mods without having to work directly with Terraria's source code itself. This means you can easily make mods that are compatible with other people's mods, save yourself the trouble of having to decompile and recompile Terraria.exe, and escape from having to understand all of the obscure "intricacies" of Terraria's source code. It is made to work for Terraria 1.3+.

Install notes

Due to rate limiting the console on the panel cannot keep up with the game console and the build will complete before the panel console may show it. Reloading the console will load it to the latest part of the log.

Minimum RAM warning

You may want to assign a minimum of 768 mb of RAM to a server as it will use around 650 mb to generate the world on the first start.

Server Ports

tModloader, like Terraria, only requires a single port to run. The default is 7777

Portdefault
Game7777

Plugins may require ports to be added to the server.

Extra Information

If you want to download mods in the console, the startup command has to be changed.

New startup: ./tModLoaderServer -ip 0.0.0.0 -port ${SERVER_PORT} -maxplayers ${MAX_PLAYERS} -savedirectory ~/ -tmlsavedirectory ~/saves -modpath ~/mods

This will remove the autocreate function, and will thus allow you to download mods and generate world. Afterwards, you can change it back with the correct world name to start automatic. Word name is set in the configuration panel.

Yolks
NameTag
Dotnet 8ghcr.io/ptero-eggs/yolks:dotnet_8
Dotnet 6ghcr.io/ptero-eggs/yolks:dotnet_6
Variables and Startup

Startup Command

./tModLoaderServer -ip 0.0.0.0 -port {{SERVER_PORT}} -maxplayers {{MAX_PLAYERS}} -password "{{SERVER_PASSWORD}}" -motd "{{MOTD}}" -lang {{LANGUAGE}} -world ~/saves/Worlds/{{WORLD_NAME}}.wld -worldname {{WORLD_NAME}} -autocreate {{WORLD_SIZE}} -config serverconfig.txt -savedirectory ~/ -tmlsavedirectory ~/saves -modpath ~/mods

Variables

World Name

The name for the world file.

Environment Variable: WORLD_NAME
Default Value: world
User Viewable:
User Editable:
Max Players

The maximum number of players a server will hold.

Environment Variable: MAX_PLAYERS
Default Value: 8
User Viewable:
User Editable:
World Size

Defines the worlds size. 3 sizes 1 (small), 2 (medium), 3 (large).

Environment Variable: WORLD_SIZE
Default Value: 1
User Viewable:
User Editable:
tModloader Version

The version of tModloader that is to be used.

Environment Variable: VERSION
Default Value: latest
User Viewable:
User Editable:
GitHub User

GitHub user to use for api calls. This only needs to be set if you hit the GitHub API too often across multiple servers.

Environment Variable: GITHUB_USER
Default Value:
User Viewable:
User Editable:
GitHub OAuth Token

This can be either an OAuth or a Personal Access Token. This is required for the install is you set a user.

Environment Variable: GITHUB_OAUTH_TOKEN
Default Value:
User Viewable:
User Editable:
Difficulty

Sets the difficulty of the world when using auto-create. Options: 0(normal), 1(expert), 2(master), 3(journey)

Environment Variable: DIFFICULTY
Default Value: 0
User Viewable:
User Editable:
Server Password

Server password for users to connect to your server. Can be empty for no password.

Environment Variable: SERVER_PASSWORD
Default Value:
User Viewable:
User Editable:
MOTD

Message of the Day for the server

Environment Variable: MOTD
Default Value: Please don’t cut the purple trees!
User Viewable:
User Editable:
Language

Sets the server language 1:English, 2:German, 3:Italian, 4:French, 5:Spanish

Environment Variable: LANGUAGE
Default Value: 1
User Viewable:
User Editable:
Install Script
#!/bin/bash
# Vanilla tModloader Installation Script
#
# Server Files: /mnt/server
## install packages to get version and download links
apt update
apt install -y file 

if [ -z "$GITHUB_USER" ] && [ -z "$GITHUB_OAUTH_TOKEN" ] ; then
    echo -e "using anon api call"
else
    echo -e "user and oauth token set"
    alias curl='curl -u $GITHUB_USER:$GITHUB_OAUTH_TOKEN '
fi

## get release info and download links
LATEST_JSON=$(curl --silent "https://api.github.com/repos/tmodloader/tmodloader/releases" | jq -c '.[]' | head -1)
RELEASES=$(curl --silent "https://api.github.com/repos/tmodloader/tmodloader/releases" | jq '.[]')


if [ -z "$VERSION" ] || [ "$VERSION" == "latest" ]; then
    echo -e "defaulting to latest release"
    DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i tmodloader.zip)
else
    VERSION_CHECK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .tag_name')
    if [ "$VERSION" == "$VERSION_CHECK" ]; then
        if [[ "$VERSION" == v0* ]]; then
            DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i linux | grep -i zip)
        else
            DOWNLOAD_LINK=$(echo $RELEASES | jq -r --arg VERSION "$VERSION" '. | select(.tag_name==$VERSION) | .assets[].browser_download_url' | grep -i tmodloader.zip)
        fi
    else
        echo -e "defaulting to latest release"
        DOWNLOAD_LINK=$(echo $LATEST_JSON | jq .assets | jq -r .[].browser_download_url | grep -i tmodloader.zip)
    fi
fi

## mkdir and cd to /mnt/server/
mkdir -p /mnt/server

cd /mnt/server || exit 5

## download release
echo -e "running: curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}"
curl -sSL ${DOWNLOAD_LINK} -o ${DOWNLOAD_LINK##*/}

FILETYPE=$(file -F ',' ${DOWNLOAD_LINK##*/} | cut -d',' -f2 | cut -d' ' -f2)
if [ "$FILETYPE" == "gzip" ]; then
    tar xzvf ${DOWNLOAD_LINK##*/}
elif [ "$FILETYPE" == "Zip" ]; then
    unzip -o ${DOWNLOAD_LINK##*/}
else
    echo -e "unknown filetype. Exiting"
    exit 2
fi

if [[ "$VERSION" == v0* ]]; then
    chmod +x tModLoaderServer.bin.x86_64
    chmod +x tModLoaderServer
else
    #tiny startup script for backward compatibility
    echo 'dotnet tModLoader.dll -server "$@"' > tModLoaderServer
    chmod +x tModLoaderServer
fi

echo -e "Cleaning up extra files."
rm -rf terraria-server-*.zip rm ${DOWNLOAD_LINK##*/}
if [[ "$VERSION" != v0* ]]; then
    rm -rf DedicatedServerUtils LaunchUtils PlatformVariantLibs tModPorter RecentGitHubCommits.txt *.bat *.sh
fi

## using config for difficulty as the startup parameter does not work -> config parser
mv /mnt/server/serverconfig.txt /mnt/server/config.txt
sed 's/#difficulty/difficulty/' /mnt/server/config.txt > /mnt/server/serverconfig.txt
rm /mnt/server/config.txt

## install end
echo "-----------------------------------------"
echo "Installation completed..."
echo "-----------------------------------------"
Installation Imageghcr.io/ptero-eggs/installers:debianInstallation Entrypointbash