
ValheimMarket
Trade at player stalls and find regional armed NPC merchants who buy materials and sell supplies.Valheim Marketplace
A marketplace for Valheim. Build a Market Stall to trade with other players, and find Edda's regional trading stalls while exploring to sell gathered goods for coins and buy supplies. The mod is a BepInEx plugin and does not require Jötunn.
Install
- Install a compatible BepInEx 5 build for Valheim on the host or dedicated server and every client.
- Copy
ValheimMarket.dllintoBepInEx/plugins/ValheimMarket/on each installation. - Start the game with BepInEx enabled. Build a player Market Stall from the hammer's Furniture category. Edda's stalls appear automatically in suitable parts of the world.
Use the same mod version on the server and every client. The server rejects market requests with a different protocol version.
How shops work
- A player shop belongs to the character who built its stalls. Only that character may post or cancel listings at those stalls. Only the builder may dismantle a player stall; stalls do not take damage.
- All stalls belonging to the same character show the same listings, offers, and uncollected goods. These records live in the server's market save, not in the physical stall.
- Every stall shows a directory of available shops. You can browse from any stall, but you must visit a stall belonging to the seller to buy, offer, or collect from that seller's shop.
- Posting an item or making an item offer removes the chosen stack from inventory and holds it in market escrow. Buying removes the listed coin price. The seller may accept or reject an offer later, even when the buyer is offline.
- Successful trades, canceled listings, and returned offers appear under Collect at any stall belonging to that seller. Collection moves the goods into inventory. If every player stall is dismantled, the shop disappears from the directory; all records return when that character builds another stall.
- Listings have no fees or expiry. A shop may have 20 active listings; a listing may have 10 pending offers. This version is intended for trusted private groups and vanilla items.
Edda the Trader
Edda is enabled by default. To disable her, set [NPC Merchant] Enabled = false in the server's BepInEx/config/dev.monokaijs.valheimmarket.cfg. Existing regional stalls remain, while Edda disappears and trading stops until the setting is re-enabled.
The server targets 20 permanent trader sites per world across large inner and outer map regions, plus a dedicated trader within 800 meters of the starting stones. It uses the world seed, terrain height, and biome to find land with a level surface, and saves each stall and character with the world. Traders appear in the Meadows, Black Forest, Swamp, Mountain, Plains, and Mistlands. Exploring within 90 meters of a stall adds a named trader pin to your map, using the game's trader icon when available. Saved trader pins and the explored area can be shared through the cartography table. The market directory also shows each region's nearest stall location. Edda is an actual armed Dverger-based character who patrols near her stall, fights hostile creatures, and retaliates if a player attacks her. She has 2,200 health at level four and deals 2.5 times the source creature's weapon damage. She refuses trades while hostile. Defeating her drops roughly 15–30 coins. She returns after two full in-game days; purchases and sales pause until then, while previously earned goods can still be collected at the stall. Talking to her and combat produce short chat lines.
Interact with Edda or her stall and open the Edda tab. What she buys depends on the biome: Meadows traders want wood, stone, flint, berries, and early crops; Plains traders also want barley and flax. She buys only full bundles. For example, 5 wood or stone pay 1 coin, and 5 carrots pay 2 coins where carrots are accepted. The sale button shows the exact payout before depositing goods. Coins appear under Collect at a stall in that region.
Her stock also depends on the biome and changes each in-game day. Meadows traders sell expensive seeds and tree supplies; Black Forest and later traders can offer copper and tin ore alongside seeds and crops. Purchases are collected at a stall in the same region. Edda does not barter. Her stock prices remain far above her material buy rates.
The server stores one market file per world at BepInEx/config/ValheimMarket/<world ID>.market and a backup at <world ID>.market.bak. Include these files when backing up or moving a world. Clients keep a pending-action journal and collection receipts in the same directory to recover from ordinary connection loss.
Build
The project targets .NET Framework 4.6.2 and compiles against your own Valheim installation. On macOS with Valheim in the default Steam path:
dotnet build src/ValheimMarket/ValheimMarket.csproj -c Release
dotnet tool install --global tcli --version 0.2.4
./scripts/package.sh 1.0.0 Creaton
On other installations, pass GameManaged (the game's Managed assembly directory) and BepInExCore to MSBuild. For example:
dotnet build src/ValheimMarket/ValheimMarket.csproj -c Release \
-p:GameManaged=/path/to/Valheim/valheim_Data/Managed \
-p:BepInExCore=/path/to/Valheim/BepInEx/core
The compiled DLL is in src/ValheimMarket/bin/Release/net462/. The packaging script creates dist/Creaton-ValheimMarket-1.0.0.zip with Thunderstore's manifest, icon, README, and plugin DLL. No game assemblies or BepInEx binaries are included. Pass -p:MarketVersion=1.2.3 to dotnet build when building a different plugin version; pass the same version to package.sh.
Run the market ledger tests with dotnet run --project tests/MarketDomainTests/MarketDomainTests.csproj -c Release.
Release to Thunderstore
Add this project to a GitHub repository, then configure its Actions settings:
- Repository secret
THUNDERSTORE_TOKEN: the Thunderstore service account key for the team that owns the package. - Repository variable
THUNDERSTORE_NAMESPACE: that team's exact Thunderstore namespace.
Run Actions → Release to Thunderstore → Run workflow on the default branch and choose patch, minor, or major. The workflow uses the highest reachable vMAJOR.MINOR.PATCH Git tag as its base; with no release tags, the base is 0.0.0. It downloads Valheim's dedicated-server assemblies and the pinned BepInEx pack, builds and tests the plugin, publishes the package to the Valheim community, then creates a GitHub release and tag. The first major release is 1.0.0.
The service account key belongs only in the GitHub secret. The repository variable and secret must be configured before starting a release.
Verification
The project builds against the locally installed Valheim and BepInEx assemblies, and the ledger tests pass. BepInEx loaded the plugin in an isolated profile containing no Jötunn. The batch-mode run did not enter a world, so regional spawning, combat, character equipment and drops, UI layout, and two-player trades still need in-game verification.
Suggested manual checks:
- Place a stall and confirm its counter shows the Open market prompt. Open it, click each tab, type in Search and the listing fields, then close it with the button and Escape.
- Find the trader near the starting stones. Approach within 90 meters, check that her pin appears on the map, write the map to a cartography table, and read it with a second character to confirm the pin transfers. Compare Meadows and Black Forest buy lists and daily stock. Try a partial bundle and a purchase without enough coins.
- Place a second player stall with the same character, post an item in one, and confirm identical stock in the other.
- Buy with another character, then collect the item and coins at either seller-owned stall.
- Make, accept, reject, and cancel item offers, including while the other player is offline.
- Dismantle the owner's last stall; verify the shop hides, then rebuild and verify all goods return.
- Let enemies attack Edda, then attack her with a player. Verify retaliation, coin drops, an empty stall, and return after two full in-game days, including across a server restart.
- Restart the server with active listings and uncollected goods. Test a full inventory and repeated clicks on Buy and Collect.
Because Valheim characters keep their own inventories, the server cannot defend against deliberately modified clients that forge deposits. The transaction journal and request IDs prevent ordinary repeated requests and help with connection loss; back up the world and market file together.