Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
GuideMaintainer authored

Server options and overrides

Every setting a host can change, where to set it, which source wins, and how to run, monitor and customise the official server image.

This is the reference page for server hosts and hosting providers: every setting the server takes, where it comes from, and how to change what the server does without touching its code.

Each setting is resolved in this order, first match wins:

  1. A command-line option, for this run only. It is never written back to server.json.
  2. server.json, read once at boot from the working directory (or the file --config names). A missing file is written with every default.
  3. The built-in default.
server.json says port 27015; this run uses 28015
./KCDCServer --port 28015

On Pterodactyl, the egg’s startup command always passes --host, --port and --config, so host and port in server.json have no effect there. Everything else in the file is still yours.

This is the complete list, as KCDCServer --help prints it:

Option Short Default What it sets
--port -p 27015 Game port: the game session over UDP and the HTTP endpoints over TCP
--host -h 0.0.0.0 Address the server binds to
--config -c server.json Configuration file, relative to the working directory
--server-token -t none Masterlist push token; the server is listed only when it is set
--password none Password players must give to join; empty lets anyone in
--download-url none Web addresses players download resources from before the game port, separated by spaces or commas
--max-downloading none Connections admitted beyond maxplayers while they download; 0 keeps downloads on player slots
--package-secret none Secret the resource package key is derived from; defaults to the server token
--help Print the list and exit

There is no option for maxplayers or anything under mod: set those in server.json.

Key Default Option that overrides it Details
host "0.0.0.0" --host
port 27015 --port
maxplayers 512 none Can only lower the cap; above 512 is clamped with a warning
server-token "" --server-token Server browser listing
password "" --password Join password, 63 bytes at most
download-url "" --download-url Serve downloads from a CDN
max-downloading 0 --max-downloading Top-level keys
package-secret "" --package-secret Top-level keys
mod.level "kutnohorsko" none Levels
mod.required_dlc [] none Required DLCs
mod.scoreboard true none Player list
mod.reveal_map true none Map discovery
mod.name "" none Server name in players’ Discord presence
mod.world_resources [] none World exports
mod.navmesh "" none Navigation mesh
map "" none Not used by KCDC

A value of the wrong type, an unknown level or an unknown DLC stops the server at boot with the reason in the log. server.json settings has the full rules.

I want to… Do this
Use another port --port, or port. In a container, change the published UDP and TCP ports to match
Listen on one interface only --host with that address
Run several servers on one machine Give each its own folder, or its own --config file and ports: --port 28015 --config second.json
Hold fewer players maxplayers below 512
Load another level mod.level: kutnohorsko, trosecko or klaster
Keep out players missing a DLC mod.required_dlc
Turn off the Tab player list mod.scoreboard: false
Let players discover the map themselves mod.reveal_map: false
Load a World Builder export Add its .world.json path to mod.world_resources and restart
Let players use World Builder in multiplayer Grant access from a server script with player.setWorldBuilderEnabled(true), see World Builder
Let NPCs walk around walls and through buildings Copy the game’s recast.pak into files/<level>/, see mod.navmesh
Make a private server password, see Password. Share it with your players
Appear in the in-game server browser server-token, see Server browser listing
Keep the token or password out of process lists Put it in server.json, not on the command line or in an egg variable
Run a different gamemode Replace resources/kcdc-gamemode with your own resource, or add yours beside it
Run with no gamemode at all Empty resources/. Players still connect; no / command answers. In a container, see below
Reload scripts without a restart ensure <resource> in the console
Change chat, spawns, commands, rules These are gamemode behaviour, not server settings: edit or replace the resource (Getting started)

The image runs /usr/local/bin/kcdc-entrypoint, which prepares /home/container, seeds the default gamemode if it is missing, then starts the server with your arguments.

Input Effect
Arguments after the image name (docker run ... IMAGE --port 28015), or Compose command Passed straight to the server. They take precedence over STARTUP
STARTUP environment variable Used by Pterodactyl Wings when no arguments are given
KCDC_VERSION, KCDC_IMAGE Only in the sample compose.yaml: pick the image tag and registry. They do not configure the server
TRACY_NO_INVARIANT_CHECK=1 Needed on CPUs without an invariant TSC (some virtual machines and emulators), where the server otherwise exits at start with Tracy Profiler initialization failure
Path What it is
/home/container Working directory and the one volume: server.json, resources/, logs, packages, crash data
/opt/kcdc/ The server binary and its libraries (read-only)
/opt/kcdc/default-resources/ What the entrypoint seeds into resources/
/usr/share/kcdc/egg-kcdc.json The Pterodactyl egg for this exact version

The server runs as UID and GID 10001, stops cleanly on SIGTERM (allow it about 30 seconds), and the image declares 27015/udp and 27015/tcp.

Seeding. On every start, each folder of /opt/kcdc/default-resources/ is copied into resources/ only if no folder of that name exists. An edited or emptied resources/kcdc-gamemode is never overwritten. So:

  • to run without the default gamemode, leave an empty resources/kcdc-gamemode folder (a folder with no package.json is not a resource), rather than deleting it;
  • to ship your own gamemode in the image, build FROM the release image and COPY it into /opt/kcdc/default-resources/ (example).

Ready. The log line KCDC Server successfully started means players can join. The Pterodactyl egg uses it as its “started” signal.

Status endpoint. GET http://<host>:<port>/ answers with JSON, handy for health checks and server lists:

GET http://127.0.0.1:27015/
{
"framework_version": "41.0.0",
"host": "0.0.0.0",
"max_players": 512,
"mod_config": { "level": "kutnohorsko", "name": "", "required_dlc": [], "reveal_map": true, "scoreboard": true },
"mod_name": "KCDC",
"mod_slug": "kcdc",
"mod_version": "1.8.1",
"password_required": false,
"port": 27015
}

port is the game port actually in use, after any override.

Log lines worth alerting on:

Line Meaning
Server will not be announced to masterlist No server-token; joinable by address only
Failed to ping masterlist server: 401 The token is wrong or its listing was deleted
Failed to start resources: N of M resources failed to start A resource is missing its built files or threw at start; the lines above name it
Could not package client resource A resource’s client script is missing, usually an unbuilt gamemode
Build mismatch from <id>, dropping peer A player’s KCDC build cannot join this server’s; see matching versions

All in the working directory. Back up the whole folder, hidden files included.

Path What it is
server.json Configuration, written with defaults on first start
resources/ Your resources
logs/ The server log
.packages/ Encrypted client packages and the archives of each resource’s custom assets. Keep it, or players re-download everything after a restart
cache/sentry/ Crash-reporting data. Crashes are reported to the KCDC developers