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.
HammerSort
Affordable build pieces first, with stable ordering. Automatically supports OdinArchitect's hammer and chisel when installed. Lightweight and client-side.
| Date uploaded | 2 weeks ago |
| Version | 1.1.1 |
| Download link | ERKEK2000-HammerSort-1.1.1.zip |
| Downloads | 32 |
| Dependency string | ERKEK2000-HammerSort-1.1.1 |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2360README
HammerSort
By ERKEK2000.
Automatically puts hammer pieces you have enough materials for first. Pieces you cannot afford follow immediately below, in the same original order. Also supports OdinArchitect's Odin's Hammer and Stone Chisel automatically when that mod is loaded and enabled.
For example, if the game's order is A, B, C, D, and you can afford B and D, the result is B, D, A, C. Once you can afford A as well, it becomes A, B, D, C.
Features
- Supports Valheim 1.0's build browser and compact hammer grid.
- Automatically includes OdinArchitect's hammer and chisel when the optional plugin is active.
- Keeps the existing order inside both groups; no alphabetical sorting.
- Updates automatically when your inventory changes and when opening or rebuilding the menu.
- Retains the selected piece, search visibility, tabs, favorites and controller navigation.
- Keeps repair/remove actions available.
- Client-side: install on the player's computer. No server installation required.
- Requires only BepInEx. MyLittleUI and Jotunn are not dependencies.
Optional OdinArchitect support
OdinArchitect is detected through BepInEx when the game starts. If it is loaded and enabled, its Odin's Hammer and Stone Chisel build menus use the same material checks, stable order, automatic updates and selection handling as the vanilla hammer. This works with OtherBuildTools = false.
If OdinArchitect is absent or disabled in your mod manager, HammerSort still loads and sorts the vanilla hammer. OdinArchitect is a soft dependency only: installing HammerSort does not install or require it or Jotunn. The optional plugin's active state is checked only for its two tools, without repeated plugin searches or new sorting buffers.
Install
Install HammerSort on Thunderstore with r2modman or Thunderstore Mod Manager. BepInExPack Valheim is the only dependency. Start the game using Start modded.
If your manager does not offer local mod import, open its profile folder and copy plugins/HammerSort/HammerSort.dll from the ZIP into BepInEx/plugins/HammerSort/HammerSort.dll.
For a local build, use Settings > Profile > Import local mod in r2modman and select the release ZIP from dist/.
If you used the private test build, remove that local copy before installing this release so that only one HammerSort DLL is installed.
Configuration
After the first modded launch, settings are saved to BepInEx/config/ERKEK2000.valheim.hammersort.cfg:
| Setting | Default | Behavior |
|---|---|---|
General.Enabled |
true |
Enable automatic sorting. Disabling restores the captured game order. |
General.OtherBuildTools |
true |
Sort all build tools, including the hoe and cultivator. Set false to limit sorting to the vanilla hammer and active OdinArchitect tools. |
Changes made through BepInEx ConfigurationManager apply immediately. When editing the file manually, close the game first. The default applies to newly created settings; existing saved values are preserved. To enable sorting for every build tool in an existing config, set OtherBuildTools = true.
What counts as affordable?
The mod checks the quantity of every required material in your inventory. Stack quantities are combined and the game's world-level item restrictions are respected. Zero-cost pieces and no-cost building modes are supported.
Station range, ground suitability, support and placement permission do not affect the order. A piece can be near the top because you have its materials and still need a workbench nearby before placing it. Nearby chest contents are not counted; mods that change resource sourcing need separate integration.
Performance
Sorting is a stable linear partition, rather than a comparison sort. Inventory quantities are counted once per change and reused across both menus. Buffers are retained, and the browser reuses existing buttons. The unchanged-frame path performs no material scan or sort. Sorting does not instantiate UI objects or run network requests.
Compatibility and validation
Built against Valheim 1.0.21, Steam build 26249040, with BepInExPack Valheim 5.4.2360. The current 1.0 PieceTable layout is used. Earlier game versions are not supported by this build.
The build, automated sorting tests and optional-tool selection checks passed. Vanilla functionality in 1.0.0 was confirmed in-game by the author. The optional integration was checked against the installed OdinArchitect 1.9.4 plugin; its in-game menus still need a smoke test with HammerSort 1.1.1. MyLittleUI's installed assembly was inspected as a reference for its craftable-first behavior; HammerSort uses its own implementation and separate build-menu hooks. Runtime compatibility with other menu replacements is unverified.
Quick in-game check
- Equip a hammer and open the build menu. In any tab, confirm affordable pieces appear first.
- Pick up, drop or spend a material while the menu is open. Confirm the groups update and retain their original internal order.
- Keep one piece selected while its affordability changes. Confirm the same piece remains selected.
- Try search, favorites, the compact grid and controller navigation if used.
- Disable
Enabledthrough ConfigurationManager and confirm the original order returns. - With OdinArchitect enabled and
OtherBuildTools = false, repeat the material-change check using Odin's Hammer and Stone Chisel. Then disable OdinArchitect in the manager, restart, and confirm the vanilla hammer still sorts.
Development references
Licensed under MIT. No game assemblies, BepInEx binaries or third-party mod code are included.
CHANGELOG
1.1.3
- Updated the short description used by Thunderstore and mod managers, with matching README introductions.
1.1.2
- Fixed clicking a sorted build-browser icon selecting a different piece. Restore the backing table before Valheim resolves a prefab to an index, so the subsequent table rebuild keeps that index valid.
- Preserve the existing compact-grid coordinate mapping and placed-piece copying behavior.
- Added regression checks for selection across inventory changes, table rebuilds and grid row boundaries.
1.1.1
- Changed the default for General.OtherBuildTools to true, enabling sorting for all build tools on new configs.
- Existing saved config values remain unchanged.
1.1.0
- Automatically supports OdinArchitect's Odin's Hammer and Stone Chisel when the optional plugin is loaded and enabled.
- Keeps vanilla hammer sorting available when OdinArchitect is missing or disabled; no new required dependencies.
- Reuses the existing stable sorting, inventory cache and selection handling for both custom menus.
- Restores browser order if optional tool support is disabled while the menu is open.
1.0.0
- Initial release for Valheim 1.0.21.
- Stable material-based sorting for the hammer browser and compact grid.
- Inventory-driven updates, retained selection and reusable sorting buffers.