Two files, not one. server.cfg runs the server: port, slots, password, pause when empty. Difficulty, death penalty, raids and PvP live in the world's save as worldSettings.cfg, and the console changes those live, no restart.
SERVER = {
port = 14159,
slots = 10,
password = ,
maxClientLatencySeconds = 30,
pauseWhenEmpty = true,
strictServerAuthority = false,
logging = true,
language = en,
unloadLevelsCooldown = 30,
droppedItemsLifeMinutes = 0,
unloadSettlements = false,
maxSettlementsPerPlayer = -1,
maxSettlersPerSettlement = -1,
zipSaves = true,
MOTD =
}
In cfg/server.cfg inside the data folder (where that is). Edit it with the server stopped: the next settings change anyone makes from the console writes the whole file back from memory.
| Key | Default | What it does |
|---|---|---|
| port | 14159 | The UDP port players connect to, 0 to 65535. Flag -port. |
| slots | 10 | Player cap, 1 to 250. Flag -slots. |
| password | blank | Blank means anyone who finds the port walks in. Console password <new> sets it live. Flag -password. |
| max | 30 | How long a lagging player hangs on before the server drops them. Console maxlatency <seconds>. No launch flag. |
| pause | true | Stops the world a few seconds after the last player leaves: clock, crops, settlers. Set false if you want the colony to carry on while you're out, and pay for it in CPU. Console pausewhenempty 0. Flag -pausewhenempty. |
| strict | false | Makes the server much stricter about what clients are allowed to do. The game's own note says to turn it on only if you absolutely have to. Flag -strictserverauthority. |
| logging | true | Writes a log file per start into logs/. Flag -logging. |
| language | en | Language of the server's own messages. Console language. Flag -language. |
| unload | 30 | Seconds an area stays loaded after the last player leaves it. Flag -unloadlevels. |
| dropped | 0 | How long dropped items last. 0 is forever, so every stack anyone drops lies there until someone picks it up. Something like 15 keeps a busy server clean. Flag -itemslife. |
| unload | false | False keeps every settlement loaded, so settlers keep working with nobody nearby. True unloads them like any other area. Flag -unloadsettlements. |
| max | -1 | Settlements one player can own. -1 or lower is no limit. Flag -maxsettlements. |
| max | -1 | Settlers one settlement can hold. -1 or lower is no limit. Flag -maxsettlers. |
| zip | true | True saves each new world as one .zip; false saves it as a plain folder. The file's own comment says true makes saves uncompressed, which is backwards: true gave us a zip, -zipsaves false gave us a folder. A folder is handier if you want to edit worldSettings.cfg by hand. |
| MOTD | blank | Message of the day, shown on join. \n for a new line. Console motd <message>. Flag -motd. |
One per world, inside its save in saves/worlds. Use the console: every row with a command changes live and saves itself. With a slash in chat it works the same for an admin.
| Setting | Default | What it does |
|---|---|---|
| difficulty | CLASSIC | casual, adventure, classic, hard, brutal. Moves the damage you take, boss health, enemy spawn rate and raider damage together; hard and brutal also cut your knockback. difficulty brutal Every boss's health on Classic and Brutal. |
| death | DROP_MATS | none · drop_mats (drops materials, keeps gear) · drop_main_inventory (everything but the hotbar and what you wear) · drop_full_inventory · hardcore (the character stays dead). deathpenalty none |
| raid | OCCASIONALLY | often, occasionally, rarely, never. Raids on your settlements. raids never |
| survival | true | Food spoils, players can starve, and settlers left hungry too long walk out. settings SurvivalMode false |
| player | true | Whether players get hungry at all. settings PlayerHunger 0 (0/1 and true/false both work) |
| disable | false | No mob spawns. settings DisableMobSpawns true |
| forced | false | PvP on for everyone, always. settings ForcedPvP true |
| allow | true | Players can bring a character made on another world. Off, everybody starts a fresh one on yours. settings AllowOutsideCharacters false |
| can | false | Settlers die for good and drop their gear instead of getting knocked down. settings CanSettlersDie true |
| disable | false | Turns mob AI off. settings DisableMobAI true |
| creative | false | One way. creativemode turns it on, nothing turns it off, and achievements die for the world and every character in it. |
| allow | false | One way. allowcheats flips it, and so does confirming any cheat command. No undo, and no achievements on that world after. |
| day | 1.0 | Day length multiplier, up to 10. No command for it: edit the file with the server stopped. |
| night | 1.0 | Night length multiplier, up to 10. Same deal. |
💡 Editing worldSettings.cfg by hand means editing inside the zip (7-Zip does it in place) with the server stopped. Only the two time multipliers need it; everything else has a command.
Tack these onto StartServer-nogui. A flag wins for that run and is never written back to server.cfg; console changes are.
| Flag | What it does |
|---|---|
| -world <name> | Loads that world, or builds it if it doesn't exist. Without it the server asks in the console. |
| -owner <name> | Owner for any client connecting with that character name. A name, not an account, so use permissions instead. |
| -nogui | No server window. The -nogui start scripts already add it. |
| -localdir | Keeps cfg, saves and logs next to Server.jar instead of the user's data folder. |
| -datadir <path> | Keeps them at that path. |
| -settings <file> | Reads a different server.cfg. Handy for two servers out of one install. |
| -ip <address> | Binds the game port to one address. |
| -port, -slots, -password, -motd | Same as the server.cfg keys. |
| -pausewhenempty, -strictserverauthority, -logging, -zipsaves, -language | Same as the server.cfg keys. Take true or false (language takes a code like en). |
| -unloadlevels, -itemslife, -unloadsettlements, -maxsettlements, -maxsettlers | Same as unloadLevelsCooldown, droppedItemsLifeMinutes, unloadSettlements, maxSettlementsPerPlayer and maxSettlersPerSettlement. |
| -worldborder <size> | Sets a world border. Off by default, and it has no server.cfg key. |
difficulty followed by casual, adventure, classic, hard or brutal on the server console, or with a slash in chat as an admin. It takes effect at once and is saved in the world. It is not in server.cfg.worldSettings.cfg inside the world's save, a zip in saves/worlds by default. Difficulty, death penalty, raid frequency, PvP, hunger and the cheat flag all live there, and the console commands change them live.-slots, -port and the rest win for that run and never get written to server.cfg. Changes made from the console do get written.dayTimeMod in worldSettings.cfg, up to 10. nightTimeMod does the same for nights. There's no command for either, so edit the file with the server stopped.Set it up, then run it from the console.