RoboDodd
Contents

Nearby Chests is a small client-side mod for Valheim. It lets you craft, build and fuel stations using what’s in the chests around you, and it turns the Stack button into a way to put everything away: each item goes to the chest that already holds it, or to a chest of similar items. A Tidy button cleans up a chest that has turned into a junk drawer.

It is free and open source, and only you need it installed. The server doesn’t.

Features

  • Craft and build from nearby chests. Workbench and forge recipes, upgrades and hammer builds count materials in chests within 30 meters. The numbers in the crafting panel and build menu include them. What you carry is spent first, then the closest chests.
  • Feed stations from chests. Coal and ore into smelters and kilns, wood into fires and hearths, fuel into cooking stations and ovens. One press still adds one item, the same as vanilla. Food and mead stay manual.
  • Stack to every nearby chest. Press Stack with a chest open, or hold E on a chest, and each stackable item goes to every chest within 15 meters that already holds it. The chest you’re using gets first pick.
  • New items find a home. An item no chest holds yet goes to the chest with the most items from the same group (metals, hides, wood, stone, raw ingredients, plants, cooked food, seeds, trophies, or materials from the same biome). Failing that it takes an empty chest, which becomes that group’s chest from then on.
  • Tidy button. A small three-bar icon left of the Stack button. It moves anything that doesn’t belong in the open chest to the right chest, pulls in strays of the chest’s own category from other chests, then merges and sorts.
  • Sorted chests. Every chest that receives items gets its partial stacks merged and its contents sorted by type, group and name.
  • Your kit stays with you. Food, meads, ammo, equipment, your hotbar and anything equipped are never stacked. Each of those has its own setting.

Screenshots

The Tidy button, circled, sits just left of Place stacks in the chest window

The circled three-bar icon is Tidy. The button next to it, labelled Place stacks in game, is the Stack button the mod takes over.

Install

With a mod manager

Install Nearby Chests from Thunderstore with r2modman or Thunderstore Mod Manager: search for Nearby Chests, or click Install with Mod Manager on the listing. BepInEx comes along as a dependency, and updates arrive through the manager.

By hand

Download a zip from the Releases page:

File Use it when
NearbyChests-x.y.z-with-BepInEx.zip You don’t have BepInEx yet. It’s included, already laid out for the game folder.
NearbyChests-x.y.z.zip You already have BepInEx installed.
  1. Open your Valheim folder, the one with valheim.exe in it. In Steam: right-click Valheim, then Manage, then Browse local files.
  2. Extract the zip straight into that folder. Windows’ Extract All suggests a new folder named after the zip, so delete that last part of the path first.
  3. Check that winhttp.dll, doorstop_config.ini and the BepInEx folder sit right next to valheim.exe. If they’re one folder too deep, BepInEx never loads.
  4. Launch the game. To confirm it loaded, open BepInEx\LogOutput.log and look for Nearby Chests x.y.z loaded.

To uninstall, delete BepInEx\plugins\NearbyChests.

Settings

After the first launch, settings are in BepInEx\config\NearbyChests.cfg. These are the ones most people change. The README lists all of them.

Setting Default What it does
CraftingRange 30 How far away, in meters, a chest can be and still count for crafting, upgrading and building (3 to 60).
StackingRange 15 How far away a chest can be for Stack and Tidy (3 to 60).
IncludeCartsAndShips false Also use cart and ship storage.
CraftFromChests, BuildFromChests, StationsFromChests true Turn each chest-material feature on or off.
StackToNearby true Turn off to get the vanilla Stack button back.
KeepHotbar true Never stack items from the top row.
ExcludeFood, ExcludeAmmo, ExcludeEquipment true Keep food, ammo and gear in your inventory when stacking.
FallbackToOpenChest false If there’s no similar or empty chest, use the open chest instead of leaving items with you.
TidyButton true Show the Tidy button (restart to apply).

Item groups

Groups decide which items count as “similar”. They live in BepInEx\config\NearbyChests.groups.txt, one line per group:

Metals = CopperOre, Copper, CopperScrap, TinOre, Tin, Bronze, ...
Cooked = Cooked*, BakedPoteitr, BoarJerky, Bread, ...
Trophies = Trophy*

Names are item prefab names (the ones the spawn console command uses) and aren’t case sensitive. A trailing * matches anything starting with that text. Edits apply the next time you stack, with no restart. Delete the file to get the latest defaults back.

Multiplayer

The mod is client-side, so it works on any server, modded or not, and other players don’t need it. Before changing a chest it takes network ownership of it, the same way the game’s own Take All does, and it skips any chest another player has open. There is one small timing window: if another player changes a chest in the same moment you craft from it or stack into it, one of the changes can be lost.

Chests it never touches

  • The Obliterator
  • Gravestones
  • Dungeon loot chests
  • Chests another player has open
  • Chests you can’t open yourself (private, or behind someone else’s ward)

Troubleshooting

  • Nothing happens in game. Check BepInEx\LogOutput.log for Nearby Chests x.y.z loaded. If the log file doesn’t exist at all, BepInEx isn’t loading, which almost always means the files were extracted one folder too deep.
  • The crafting panel doesn’t count a chest. It’s outside CraftingRange, another player has it open, or it’s a chest you can’t open.
  • An item stays in my inventory when I stack. It’s food, ammo, equipment, on your hotbar or equipped. Otherwise there was no chest holding it, no chest of similar items and no empty chest in range. The on-screen message says how many were left over.
  • It broke after a Valheim update. Check the Releases page for a new version, and if there isn’t one, open an issue.

Bugs and requests go on the GitHub issues page.