An advanced tool to save, name, manage, and build custom multi-piece structures in Valheim using manual green pulsating highlights or radius selections.
Fixed Offline/Singleplayer Spawner Execution: Fixed an issue in the origin-spawning protection where players with a creator ID of 0 (common in offline play and local test characters) would trigger early-return exits. This caused placed prefabs to render overlapping parent visual meshes (creating a "damaged" texture look due to z-fighting) and bypassed Undo list registration.
Native Valheim Placement Hook: Reimplemented the spawner check using Valheim's native IPlaced interface, ensuring that only legitimate player placements trigger the blueprint spawning routine while completely bypassing problematic player ID/name checks.
v1.0.8
Fixed Origin Spawning Bug: Fixed a critical issue where cloning the custom prefab for icons, menu renders, or asset loads caused the spawner script to execute incorrectly, instantiating the entire blueprint at the world origin (0, 0, 0). Added active local player and non-zero creator ID checks to ensure spawning only happens on real player placements.
MovingDay Compatibility: Added seamless selection synchronization with the MovingDay mod. If both mods are installed, they will automatically share the exact same selected pieces list. Highlighting pieces in one mod allows you to use the other mod's functions (e.g. moving a PrefabHammer selection, or saving a MovingDay selection as a prefab). Both mods will correctly clean up highlight overlays when selections are cleared or deselected.
Click-to-Bind Keybinds: All hotkeys now use BepInEx's native keybind system. In the in-game configuration manager, click a keybind button and press the desired key combination to set it — no more typing key names manually.
Dedicated Manager Hotkey: Opening the Library tab now has its own configurable keybind (ManagerHotkey, default: Left Shift + K) separate from the save key.
Modifier Keys Per Binding: Each hotkey can now have its own modifier key combination instead of sharing a single global modifier. Set any combo (e.g., Ctrl+J, Alt+U) per binding.
Keybinds Config Section: All hotkey settings are now grouped under a dedicated [Keybinds] section in the config file for easier organization.
⚠️ Existing Configuration: If you are upgrading from v1.0.7 or earlier, your existing keybind settings (SaveHotkey, SelectHotkey, UndoHotkey, ModifierKey) will no longer work because they used the old string-based format (e.g. K, LeftShift). To fix this, delete your BepInEx/config/com.prefabhammer.cfg file and relaunch the game — BepInEx will regenerate it with the new keybind entries and defaults.
v1.0.7
Batched Placement: Large blueprints are now built in small batches across multiple frames, eliminating freezes when placing structures with hundreds of pieces. A progress message displays during placement (e.g. "Placing MyBase... 30/120").
Undo Placement (Shift+U): Undo recently placed blueprints. Opens the manager directly to the Undo History tab where you can select a placement to remove. Materials are refunded by dropping them at the original piece locations.
Structural Integrity: Placed structures now correctly calculate structural integrity after construction completes. Hover pieces with the hammer to see stability colors as expected.
Improved GUI: Restyled the manager window to match Valheim's wooden/medieval aesthetic with gold text and recessed dark panel backgrounds for scrollable lists.
New Configuration Options (found in com.prefabhammer.cfg):
PlacementBatchSize (default: 10) — Number of pieces placed per frame. Lower values reduce stuttering on slower hardware.
MaxUndoHistory (default: 5) — How many recent placements are kept in the undo history.
v1.0.6
Fixed IndexOutOfRangeException in Hud.SetupPieceInfo when selecting custom prefabs for placement.
Appended a complete total cost requirement list (with player inventory counts color-coded) to the piece description panel in the HUD when a custom prefab's requirements exceed the available display slots.
v1.0.5
Removed excessive log spamming.
v1.0.4
Fixed issues with the new Prefab tab not appearing correctly and some weird interactions with other mods that added new tabs to the build hammer menu.
v1.0.3
Added Dedicated Build Tab ("Prefab"): All your custom saved structures will now be loaded under the category tab defined in the configuration (defaults to the new dedicated "Prefab" tab).
Update Notice: If you are updating from a prior version, your existing configuration file may still point to "Misc". If you wish to use the new dedicated tab to store and organize your designs, please change the BuildCategory setting in your configuration file (com.prefabhammer.cfg) to "Prefab".
PieceTable Sizing: Implemented runtime memory array expansion for PieceTable to handle the new category index safely without crashes.
Improved UI Integration: Integrated with the vanilla category navigation so players can cycle to and click the new "Prefab" tab naturally.
v1.0.2
Fixed Saving & Persistence: Refactored the spawner instantiation path to use standard Unity instantiation. Placed custom prefabs now naturally register their ZDOs as persistent, meaning they save and load correctly when logging out and back in.
Fixed Build Sound & Particle Effects: Added code to copy the placement effects (m_placeEffect) from the first sub-piece to the custom composite piece. placing a custom prefab now plays the hammer hits and wood/stone dust particles.
Fixed Mod Icon Validation: Converted the mod icon to a true 256x256 PNG format, resolving the Thunderstore validation error.
Naming Migration: Completed full name migration from ModularHammer to PrefabHammer internally and externally.
v1.0.0
Initial release of PrefabHammer.
Support saving, naming, and building custom multi-piece structures in Valheim.
Pulsating direct-cloned green selection outlines conforming to piece shape.
Library dashboard to manage and delete custom prefabs with instant Valheim build menu refresh.