Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
AutoChestSort
Name your chests. Teach them once. Let the server keep things tidy. (Multi+Singleplayer)
By NexGaming
CHANGELOG
Changelog
1.1.2 (2026-11-02)
Hotfix for Valheim 1.0.21 and for an item risk on self-hosted and single player games. Client and
server must both run 1.1.2: the version check compares the full version and turns a client with ACS
1.1.1 away. Players without the mod (allowVanillaClients = true) are not affected. Tested on
Valheim 1.0.21; the requirements stay the same (BepInExPack 5.4.2350, Jotunn 2.30.2 or newer).
Fixed
- ACS could write into a chest the host had open (since 1.0.0, host and single player). When
you host from your own game or play alone, the sorter did not count your own open chest as open.
It could move items into or out of it while you had it open; the game then saved the content from
the moment you opened it back over those moves, and items were lost (moved in) or doubled (moved
out). A chest the host has open is now always left alone, whatever
ignoreInUseWhenOwnerDisconnectedsays. If you host or play alone and stay on 1.1.1 for now, setignoreInUseWhenOwnerDisconnected = false: that protects a chest that is open while ACS writes, not one opened just after a write, and a chest a crashed client left marked as open then stays blocked until someone opens and closes it. - A chest opened or broken right after a move could bring its old content back. The game does not reload a chest when you open it. Opened within about a second of a server move, it showed the old content and saved it back with your first change (lost at the target, doubled at the source); broken in that moment, it dropped the old content. Clients and hosts with ACS now load a chest fresh when it is opened or broken, and the server sends a chest it changed straight to the player whose game holds it. That makes the window smaller, it does not close it: network delay remains, and players without the mod keep the window of about a second.
- Cheat mark of Valheim 1.0.21. ACS 1.1.1 merged stacks without looking at the new mark, so a
merge could drop it or put it on clean items. With the default
sortCheatedItems = falsecheated stacks are no longer touched at all (see below). In every mode, an item moved from a chest still saved in the old format into one saved in the new format no longer brings back a mark the game had cleared. - A move could leave a stack in both chests on Valheim 1.0.21. If the game saved the source chest again in the new format between the two writes of a move, taking the stack out of the source could fail and the stack stayed in both chests. The source is now compared and rewritten in the format it has at that moment.
Added
sortCheatedItems(server, admin only, defaultfalse). Valheim 1.0.21 marks items spawned with cheats and things made from them. WithfalseACS never touches a cheated stack: not moved, not merged, not rearranged, it stays where it is. Clean items in the same chest are sorted as usual. Admins get one chat line about it at most every five minutes, e.g.Cheated item Wood x12 in chest wood - set sortCheatedItems=true to disable this message.trueignores the mark and sorts these items like any other, as before.- New lines in
acs_sort status:sorter cheated items:(mode, item version of the game, last notice),sorter hold rule:(which open chest rule applies) andsorter owner push:(chests sent straight to their owner); on a client or host alsoACS local chest reload hook:(chests loaded fresh on open and before breaking).
Changed
- On a game before Valheim 1.0.21 ACS sorts exactly as 1.1.1 did. If a later game update saves chests in an item format newer than the one ACS knows, the sorter writes nothing and logs a warning until ACS is updated.
- The description of
ignoreInUseWhenOwnerDisconnectednow says what it does: it ignores the open mark of a player who is no longer connected or more than 20 m away from the chest, and it never applies to the host's own player.
1.1.1 (2026-10-03)
Client and server must both run 1.1.1: the version check compares the full version and turns a
client with ACS 1.1.0 away. Players without the mod (allowVanillaClients = true) are not affected.
Added
- Raid pause. While a raid is running anywhere in the world, the server makes no move at all,
in every base. A raid counts as running while a player is inside its area, the same rule the game
uses for its own clock. When the raid ends, or every player has left its area, sorting resumes
60 seconds later. If the server cannot read the raid state, it keeps pausing and logs one error
line. Always on, no setting.
acs_sort statusshows the state in the linesorter raid pause:.
Changed
- Requirements are minimum versions: BepInExPack 5.4.2350 or newer, Jotunn 2.30.2 or newer; the plugin now refuses to load with an older Jotunn instead of failing later.
1.1.0 (2026-10-01)
Client and server must both run 1.1.0: there are new answers between them, and the version check turns a mismatched client away.
Fixed
- Groups were lost on a server restart. A group file holding only
ACS_groups: {}(what the server writes for a world without groups) was taken as broken, and from then on nothing was saved. Everything taught afterwards was gone after the next restart. An empty file is valid now:ACS_groups: {},ACS_groups:with nothing below it, an empty or missing file. - A repaired group file that still carries the hint loads quietly. If the admin fixed the file
but left the two
# ACS-PROBLEM:lines at the top, the server loads it like any other file and saves it again without them: no.broken-*copy, no warning, and the.bakkeeps the last clean version. Before, the leftover hint alone counted as a correction, with a warning and a copy that was identical to the file saved right after. - The group file says who writes it. Two new comment lines at the top: the file is written by
AutoChestSort, comments and layout are lost on the next save, and it should be edited only to
repair a locked file, then reloaded (panel button or
acs_groups_reload).
Added
- Revert watch. After a move has passed its read back, ACS keeps watching both chests for up to
180 s. If a foreign write puts one of them back on exactly the content it had before the move,
with no sign of a player, it is recorded as an incident: a warning in the server log (target
chest: the moved item is probably lost; source chest: it probably exists twice), the conflict
counter
reverts, and the chat warning counts it like any other conflict. ACS does not compensate it, it reports it. With player activity at the chest in that time (opened, in use, a new owner, several writes) it is only an info line, not an incident. Background: on a dedicated server the game of a player near a chest can write to it (rain damage, building support) in the same instant as a server move, both writes carry the same revision and each side drops the other one, and the next write from the player's game can silently bring the old content back - after the read back has already said "ok". - Incident ledger
incidents.log. One line per incident, append-only, shared by all worlds of the server, in theAutoChestSortfolder of the BepInEx config next toworlds/. It is created with the first incident. Every server start logsincident ledger: N incident(s) on record (this world: M), last: .... acs_incidents [n]lists the last n incidents from the server's ledger, newest first (default 10, at most 100), with the totals overall and per world. Any player, no open chest needed, read only.- Rain guard. An unroofed chest takes rain damage every 60 seconds, and every hit is a write
into the chest. ACS learns that rhythm from the chest's health and does not write to the chest in
the two seconds around its next expected hit (a few seconds longer after a repair). The new wait
reason
ForeignWriteExpected(rain write expected, N s left) shows in the debug log, inacs_sort statusand inacs_dump. Only chests of clusters with a player withinactivationRadiusare sampled, every 0.25 s. No setting. Not covered: the first hit of each rain period, attacks, and chests on a building that the game rewrites for its support - those keep the usual quiet window. - New lines in
acs_sort statusandacs_dump:sorter rain guard: ...andsorter revert watch: ...;acs_dumpalso showssorter provenance: ...(how many chest changes were ACS's own writes and how many came from outside). - Move lines in the debug log carry a move number per session (
move #12 ...), so a warning of the revert watch can be matched to its move. acs_debug_server on|off|statusswitches the server's verbose log live from the client console.onandoffare for admins only (the server's admin list); anybody else getsrefused, you are not on the admin listand the server logs the attempt.statusis open to every player.acs_debugis now local only: it switches the log of your own game and no longer the server's.
Changed
- No automatic reload of the group file any more. The server reads it when the world starts and
after that only on request: the new
↻button in the chest panel or the new console commandacs_groups_reload(any player, no open chest needed, at most every 5 seconds).- An edit without a reload is ignored.
- The server does not overwrite it, it locks instead: if the file on disk changed when the server wants to save, it saves nothing and waits for a reload.
- A learn confirmed in the UI can be discarded by the reload: the reload takes the edit over and drops the group changes the server had not saved yet. The server log lists them.
- Hot reload of the config file (
.cfg) is unchanged.
- A broken group file locks instead of guessing. Every player's chest panel shows only
malformed group yml – see server log(orgroup yml changed on server – reload) in the name field, the four buttons are hidden and only the reload button is there. After a failed reload the player who pressed it readsreload failed – malformed group yml. Every group change is refused while the file is locked. - The sorter pauses while the group file is locked, tidy-up and group reconcile included, so a
start with a broken file can no longer empty
Inputand group chests intoMisc.Inputchests fill up until the file is repaired and reloaded. - Strict check of the group file — this can lock files that loaded in 1.0.0. One line the
server cannot read now locks the whole file, even next to readable groups: a line without
name: value, a group line without indentation, anything after the block, an empty group name,input/miscas a group, an empty item name (- ""). 1.0.0 skipped such lines and used the rest; the next save then dropped them without a trace. - Content after a closing
]is an error. Only a# commentmay follow an item list;bau: [Wood] Stoneortest: [] ::lock the file. 1.0.0 ignored the rest of the line, soStonewas lost without a word. - An item name with spaces is an error. No prefab name contains a space, so
bau: Wood Stone,- Wood Stoneor[Wood Stone, Resin]lock the file (quoted names too); write one item per entry or[Wood, Stone]. Before, such an entry was read as the single unknown itemWood Stoneand removed. - A list inside a list entry is an error. A
-entry holds one item name, so- [Wood],- [Wood, Stone],- [],- {}or- wood: Woodlock the file; write- Woodper line orbau: [Wood, Stone]. Before,- [Wood]was read as the unknown item[Wood]and removed. A quoted- "[Wood]"is still read as an item name and removed as unknown. - The group file must be UTF-8 (with or without BOM). A file saved as Latin-1/ANSI or with a
UTF-16/32 byte order mark is not read at all: the file locks, the log says "the group file is not
valid UTF-8 (saved as Latin-1/ANSI?) - save it as UTF-8 and reload" and names the first bad byte,
no hint is written into it and it stays untouched; a byte-exact
.broken-*copy is made. 1.0.0 read such a file with�in place of every umlaut and saved that on the next change. - Hint at the top of a locked file. The server writes two
# ACS-PROBLEM:comment lines at the top of the group file naming the first problem and its line (the rest of the file stays as it was), so the admin finds it without the log. Written once, only with a quarantine copy in place and only into UTF-8 files (a file that is not UTF-8 is locked without a hint); removed by the first save after the repair. - Autocorrect of item mistakes on start and reload. An item in two groups stays in the first
one, an item or a group listed twice is merged, and an item name the game does not know is
removed (in 1.0.0 it was only warned about). The corrected file is saved right away, every fix
is logged with group and line. The original goes into a
.broken-*copy first — the admin's comments and layout survive only there. Nothing is corrected when that copy cannot be written. - Safety net for unknown items. If all items are unknown, more than half of them or more than 20, nothing is removed and the file locks instead ("prefab check looks unreliable or the file lists mostly unknown items"): that looks like a missing mod, not like typos. While the game cannot answer the check yet, nothing counts as unknown.
- Backup and quarantine next to the group file. Before every save the previous version is kept
as
<world>.yaml.bak— always a clean, loadable version, and an empty one never replaces a.bakthat holds groups; a corrected original never becomes the.bak. A broken file, or one that is about to be corrected, is copied as<world>.yaml.broken-yyyyMMdd-HHmmssbefore anything else happens, at most five copies. - New answer codes between client and server for the lock (malformed, reload failed, changed on disk) and a new request for the reload. A 1.0.0 client cannot talk to a 1.1.0 server, and the other way round.
- Beautify waits 20×
closeCooldownSecondsinstead of 60× — one minute at the default instead of three. The log line for a chest that is not quiet yet names the quiet window, the time left and the last change (quiet window 60 s, 42 s left, last change 18 s ago), and is written again when the window restarts because the chest changed. - Spreading: among chests of equal size the least movement wins. When several chests of a group have the same usable room, the planner now picks the assignment of item types to those chests that moves the fewest items (an exact least-movement assignment instead of a tiebreak). This stops the ping-pong where a whole stack type moved between two equal chests because a few stacks of another type tipped the tiebreak. After the update a group may reorder itself once - small types can move to the equal chest where they now belong; after that the layout stays put. Not covered: a tie between chests of different size that happen to have the same usable room (a bigger chest partly taken up by gear the mod does not move, for example). That case is known and can still cost the odd extra move; the cycle guard stops a real back and forth.
- The spreading plan is kept while a chest of the group is open or settling. No more rebuilds and repeated "equal chests reassigned" lines while somebody fills a chest; the next plan is worked out once every chest of the group is quiet again, and compared with the kept one.
- ACS's own writes keep the plan valid. A beautify rewrite, a merge of partial stacks inside a
chest and the spreading moves themselves no longer throw the plan away. An
Inputor tidy-up move into a group chest does change what the group holds, so the plan is rebuilt; the debug log tells such an own move apart from a change from outside. - The "cannot be sorted any further" line is keyed by the content of the group, so a beautify rewrite no longer repeats it.
acs_sort statusandacs_dumphave a new linesorter distribution planning: ...:plan changes N (content changed N, inside one class of equal chests N, cross-class split ties N), reassigned among equal chests N, plan build max X ms, last Y ms, cycle stops N, plan builds skipped while blocked N. A plan change after a real change of content is counted ascontent changed, not as a change inside a class of equal chests.
Requirements: BepInExPack 5.4.2351, Jotunn 2.30.2, Valheim 1.0.x (tested on 1.0.15 and 1.0.16).
1.0.0 (2026-09-18)
First public release.
- Name chests in the chest window; chests with the same name form a group.
- Teach a group with
+: the item types lying in that chest now belong to the group. - The server empties every
Inputchest, one stack per second, into the matching group chest nearby, or intoMisc, or leaves the stack where it is. - Chest-to-chest tidying: items in the wrong chest move to their group, unassigned items to
Misc. - Clusters: chests within
graphEdgeRadius(default 12 m) of each other form one sorting area. - Spreading stage: a group with several chests is filled so that one chest holds one item type wherever possible, with stack top-ups and buffer moves.
- Optional beautify pass (
beautifyChestItemOrder, off by default): tidies each group chest, same items side by side, full stacks first. - Server settings in a BepInEx
.cfgwith Jotunn admin sync and hot reload;acs_*console commands for status, dump and diagnostics. allowVanillaClients(defaultfalse): a server refuses clients without the mod. Set it totruefor mixed play.- Every move is checked: add at the target, remove at the source, read back and verify. Counters
for lost, duplicated and unbalanced items in
acs_sort status.
Requirements: BepInExPack 5.4.2350, Jotunn 2.30.0, Valheim 1.0.x (tested on 1.0.12 and 1.0.14).
The mod has to run on the server and, unless allowVanillaClients is on, on every client.