Valheim
You are viewing a potentially older version of this package. View Latest Version
Install with App

Details

Date Uploaded
3 weeks ago
Downloads
293
Size
47KB
ADDatHost Valheim hosting
30% off

Valheim Marketplace

A player-run marketplace for Valheim. Build a Market Stall with the hammer, then interact with it to browse shops, sell an item for coins, make an item-for-item offer, or collect completed trades. The mod is a BepInEx plugin and does not require Jötunn.

Install

  1. Install a compatible BepInEx 5 build for Valheim on the host or dedicated server and every client.
  2. Copy ValheimMarket.dll into BepInEx/plugins/ValheimMarket/ on each installation.
  3. Start the game with BepInEx enabled. Build a Market Stall from the hammer's Furniture category. It uses the wooden chest recipe.

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 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 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 the seller dismantles every stall, 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.

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 stall placement, UI layout, and two-player trades still need in-game verification.

Suggested manual checks:

  1. Place two stalls with one character, post an item in one, and confirm identical stock in the other.
  2. Buy with another character, then collect the item and coins at either seller-owned stall.
  3. Make, accept, reject, and cancel item offers, including while the other player is offline.
  4. Dismantle the owner's last stall; verify the shop hides, then rebuild and verify all goods return.
  5. 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.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.