ValheimAutoSort
Sorts nearby chests on keybind (Alt+R). Spatial ordering, fill-first tagged chests, stack consolidation, safe overflow handling, ground-item duplication fix. Multiplayer compatible.
About this mod Author’s original text
ValheimAutoSort v2.4.0
Sorts nearby chests on demand with a single keypress. Chests infer their own category from
their contents; you can pin a category permanently with the catagory dropdown inside in-game containers.
Multiplayer compatible via ZDO sync.
Features
| Feature | Detail |
|---|---|
| Keybind sort | Press Alt+R (configurable) to sort all chests within ScanRadius |
| Spatial ordering | Chests filled in reading order (top-left → right, then down); same-category chests grouped together |
| Fill-first tagged | Tagged chests of the same category fill completely before spilling to the next |
| Category inference | Chest dominated by Wood items "owns" Wood — no setup needed |
| Tag override | autosort_tag Wood while looking at a chest pins it to Wood permanently |
| Ground suction | Dropped items on the ground are periodically pulled into matching chests |
| Hover tooltip | Shows chest category, tagged/inferred, and the sort keybind reminder |
| Visual effects | Blue highlight + particle VFX on sorted chests (configurable) |
| Multiplayer | MoveItemToThis + ZDO dirty-mark; no server plugin required |
Configuration
Config file location after first launch:
BepInEx/config/com.yourname.valheim.autosort.cfg
Editable in-game via r2modman config editor or any text editor.
1 — General
| Key | Default | Description |
|---|---|---|
| ModEnabled | true | Master switch. Disables everything without uninstalling. |
| LogDebug | false | Verbose BepInEx console logging for troubleshooting. |
2 — Chest Tagging
| Key | Default | Description |
|---|---|---|
| EnableTagOverride | true | Allow autosort_tag to pin chests. Requires relogging to affect existing chests if changed mid-session. |
3 — Sort Pass
| Key | Default | Range | Description |
|---|---|---|---|
| SortKeybind | Alt+R | Any key combo | Keyboard shortcut that triggers a full sort. Configurable via r2modman. |
| ScanRadius | 16 | 4 – 64 m | Radius around the player within which chests are included in a sort pass. |
4 — Ground Items
| Key | Default | Range | Description |
|---|---|---|---|
| EnableGroundSuck | true | — | Pull ground items into matching chests periodically. |
| GroundSuckRadius | 8 | 2 – 32 m | Radius around the player to search for ground items. Independent of ScanRadius. |
| GroundSuckInterval | 5 | 1 – 60 s | Seconds between ground scans. Lower = more responsive, slightly more CPU. |
5 — Effects
| Key | Default | Description |
|---|---|---|
| HighlightContainers | true | Flash chests blue when items are sorted into them. |
| PingContainers | true | Spawn a particle VFX at sorted chests. |
| PingVFX | vfx_Potion_health_medium | VFX prefab name. Leave blank to disable. Browse prefabs |
Usage
Basic (zero setup)
Build chests near each other and put a different type of item in each.
After a few deposits the mod infers each chest's category.
Press Alt+R whenever you want items redistributed.
Tagging a chest manually
Look at the chest, open console (F5):
autosort_tag Stone
Valid categories (case-insensitive):
Stone, Wood, Metal, Ore, Gem, Leather, Bone, Fiber, Seed,
Food, Potion, Fish, Arrow, Weapon, Shield, Armor, Tool,
Magic, Trophy, Furniture, Misc
Clear a tag:
autosort_tag
How It Works
Player presses Alt+R
│
▼
Patch_Player_Update detects SortKeybind.IsDown()
(blocked if inventory / map / store GUI is open)
│
▼
SortEngine.TriggerSortPass()
├─ Sets IsRearrangingItem = true (blocks all AddItem callbacks)
├─ Yields one frame
│
└─ DoSort(playerPosition)
├─ ChestOwnershipResolver.Resolve()
│ ├─ Tagged chests → pinned category, priority 1
│ │ └─ Multiple tagged of same category: rightmost first
│ └─ Inferred chests → dominant item category, priority 2
│
├─ ChestOwnershipResolver.PlanSortFull()
│ ├─ SortInferredByPosition()
│ │ ├─ Pass 1: reading order (top-left → right, then down)
│ │ ├─ Pass 2: find each category's earliest spatial anchor
│ │ └─ Pass 3: cluster same-category chests at their anchor
│ │
│ └─ FindDest() priority chain (m
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: