AutoSortChests
Adds a Sort button to every chest window: merges identical stacks and orders items by type and name.
Screenshots 1 screenshots
About this mod Author’s original text
Valheim Auto Sort Chests
BepInEx mod for Valheim that adds a Sort
button to every container (chest) window, between the game's own "Take all"
and "Place stacks" buttons.
Clicking it:
- Merges identical item stacks into as few stacks as possible (same rule
the game itself uses to decide if two items can stack).
- Lays out the remaining items in a consistent order: by item type, then
alphabetically by name.
Unofficial mod. This is a fan-made mod, not affiliated with or endorsed by
Iron Gate. It marks your game as modded (the game shows this in the main menu),
as Iron Gate asks mod authors to do.
Requirements
- Valheim (tested on 1.0.15)
- BepInEx 5.4.x
Installation (players)
- Install BepInEx for Valheim if you haven't already (see link above, or
use r2modman).
- Download AutoSortChests.dll from the
latest release.
- Drop it into \BepInEx\plugins\AutoSortChests\.
- Launch the game and open any chest - you'll see the new "Sort" button.
Upgrading from 0.1.0: the DLL used to be called Mod3-AutoSortChests.dll.
Delete the old BepInEx\plugins\Mod3-AutoSortChests\ folder after installing
the new version (the mod keeps no data there).
Building from source
Requires the.NET 8 SDK (or newer)
and a local Valheim install with BepInEx installed.
git clone
cd valheim-auto-sort-chests
dotnet build -c Release -p:ValheimPath="C:\Path\To\Valheim"
If you don't pass -p:ValheimPath, the build looks for a VALHEIM_PATH
environment variable, then falls back to the default Steam location
(C:\Program Files (x86)\Steam\steamapps\common\Valheim).
The build automatically copies the built DLL into
\BepInEx\plugins\AutoSortChests\ for quick in-game testing.
How it works
A Harmony postfix on InventoryGui.Awake clones the existing "Stack All"
button to create the new "Sort" button (same style, correctly anchored),
positioned between "Take All" and "Stack All". Sorting operates directly on
Inventory.GetAllItems() (the live internal list) and reassigns each item's
grid position - no reflection into private container internals needed beyond
one field lookup for the currently-open container.
Support
All my mods are free and will stay free. If you enjoy them and want to say
thanks, you can leave a voluntary tip via PayPal - it doesn't
unlock anything, it just helps me keep making mods.
License
MIT - see LICENSE.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: