This mod provides a dedicated (headless) server for Stardew Valley, powered by SMAPI. It turns the host farmer into an automated bot to facilitate multiplayer gameplay.
Upon running SMAPI with the mod installed for the first time, a config.json
file will be generated in the mod's folder. This file specifies which farm will be loaded on startup, farm creation options, host automation details, and other mod configuration options. Default values will be provided, which can then be modified. Here is an overview of the available settings:
FarmName
: The name of the farm. If a farm with this name exists, it will automatically be loaded and hosted for co-op. Otherwise, a new farm will be created using the specified farm creation options and then hosted for co-op.
StartingCabins
: The number of starting cabins for the farm. Must be an integer in {0, 1, 2, 3}.CabinLayout
: Specifies the starting cabin layout. Options are "nearby" or "separate".ProfitMargin
: The farm's profit margin. Options are "normal", "75%", "50%", and "25%".MoneyStyle
: Determines whether money is shared or separate among farmers. Options are "shared" or "separate".FarmType
: The type of farm. Options include "standard", "riverland", "forest", "hilltop", "wilderness", "fourcorners", and "beach".CommunityCenterBundles
: The community center bundle type. Options are "normal" or "remixed".GuaranteeYear1Completable
: Set totrue
orfalse
to determine if the community center should be guaranteed completable during the first year.MineRewards
: The mine rewards type. Options are "normal" or "remixed".SpawnMonstersOnFarmAtNight
: Set totrue
orfalse
to determine if monsters should spawn on the farm at night.RandomSeed
: An optional integer specifying the farm's random seed.
AcceptPet
: Set totrue
orfalse
to determine if the farm pet should be accepted.PetSpecies
: The desired pet species. Options are "dog" or "cat". Irrelevant ifAcceptPet
isfalse
.PetBreed
: An integer in {0, 1, 2} specifying the pet breed index. 0 selects the leftmost breed; 1 selects the middle breed; 2 selects the rightmost breed. Irrelevant ifAcceptPet
isfalse
.PetName
: The desired pet name. Irrelevant ifAcceptPet
isfalse
.MushroomsOrBats
: Choose between the mushroom or bat cave. Options are "mushrooms" or "bats" (case insensitive).PurchaseJojaMembership
: Set totrue
orfalse
to determine if the automated host should "purchase" (acquire for free) a Joja membership when available, committing to the Joja route. Defaults tofalse
.
EnableCropSaver
: Set totrue
orfalse
to enable or disable the crop saver feature. When enabled, seasonal crops planted by players and fully grown before the season's end are guaranteed to give at least one more harvest before dying. For example, a spring crop planted by a player and fully grown before Summer 1 will not die immediately on Summer 1. Instead, it'll provide exactly one more harvest, even if it's a crop that ordinarily produces multiple harvests. Defaults totrue
.
MoveBuildPermission
: Changes farmhands permissions to move buildings from the Carpenter's shop. Is set each time the server is started and can be changed in the game. Set tooff
to entirely disable moving buildings, set toowned
to allow farmhands to move buildings that they purchased, or set toon
to allow moving all buildings.
All commands in the game must be sent privately to the player ServerBot
. For example, you must write the following /message ServerBot MoveBuildPermission on
.
MoveBuildPermission
: Changes farmhands permissions to move buildings from the Carpenter's shop. Set tooff
to entirely disable moving buildings, set toowned
to allow farmhands to move buildings that they purchased, or set toon
to allow moving all buildings. The changes are transferred to theconfig.json
file.movepermissiong
: Alias for MoveBuildPermissionmbp
: Alias for MoveBuildPermission
This mod can be run without the use of a GUI. To start the game, you must enter the following command:
xvfb-run -a "$HOME/GOG Games/Stardew Valley/game/StardewModdingAPI"
You can shut down the server from the started terminal session by pressing Control-C
.
From another terminal session, you can send Control-C
with kill -SIGINT ....
.
ps -aux | grep StardewModdingAPI
kill -SIGINT ....
If Stardew Valley was not installed in the default path, the installation path must be added to the project file DedicatedServer.csproj
. Add the path with the tag GamePath
to the PropertyGroup
. Depending on the path, it should look something like this:
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<GamePath>D:\SteamLibrary\steamapps\common\Stardew Valley</GamePath>
</PropertyGroup>