You are viewing a potentially older version of this package. View all versions.
DrakosDJ-PrefabHammer-1.0.7 icon

PrefabHammer

An advanced tool to save, name, manage, and build custom multi-piece structures in Valheim using manual green pulsating highlights or radius selections.

Date uploaded a week ago
Version 1.0.7
Download link DrakosDJ-PrefabHammer-1.0.7.zip
Downloads 135
Dependency string DrakosDJ-PrefabHammer-1.0.7

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2333 icon
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.2333

README

Prefab Hammer

Prefab Hammer is an advanced construction utility for Valheim. It allows players to capture custom build combinations (prefabs/blueprints) directly from their existing structures, name them, manage them in a catalog, and build them using standard resource calculations.

Features

  • Manual Component Selection: Aim at built pieces and press J to select them one-by-one with a pulsating green outline.
  • Exact Geometry Outlines: Selection highlights clone the piece's actual visual meshes, making the green transparent overlay conform precisely to floors, sloped roofs, beams, and custom shapes.
  • Name & Save Dialog: Press K to open the solid-colored popup manager, name your creation, and save it.
  • Prefab Library Catalog: View your blueprints in a scrollable list, delete them safely with confirm prompts, or open the catalog using Delete or Shift + K.
  • Batched Placement: Large blueprints are built in small batches across multiple frames — no freezes, even with 1000+ piece structures. Progress messages display during placement.
  • Undo Placement: Press Shift + U to open the Undo History tab and remove recently placed blueprints. Materials are refunded by dropping them at the original piece locations.
  • Structural Integrity: Placed structures correctly calculate stability after construction. Hover pieces with the hammer to see support colors.
  • Unequip Cleanup: Switching away from the Hammer automatically clears outlines and selections to prevent world clutter.
  • Radius Fallback: Pressing the save hotkey without selecting anything falls back to saving all pieces in a radius.
  • Chat Commands: Use /prefablist, /prefabsave, /prefabreload, and /prefabdelete.

Keybinds (Configurable)

  • J: Toggle manual piece selection (must hold Hammer).
  • K: Open save panel / Prefab Manager.
  • Delete or Shift + K: Open Library Catalog directly.
  • Shift + U: Open Undo History tab.

Installation

Prefab Hammer requires BepInEx to run.

  1. Install BepInExPack Valheim.
  2. Place PrefabHammer.dll into the BepInEx/plugins/ directory (or download directly via r2modman).

Configuration

You can customize the mod's behavior by editing BepInEx/config/com.prefabhammer.cfg (or using r2modman's Config Editor):

  • BuildCategory: The build menu category tab where your custom prefabs are loaded (default: Prefab). Can be set to vanilla tabs like Misc, Crafting, Building, or Furniture.
  • SaveHotkey: Hotkey to open the save panel (default: K).
  • SelectHotkey: Hotkey to toggle selecting pieces (default: J).
  • UndoHotkey: Hotkey to open the Undo History tab (default: U, used with the modifier key).
  • ModifierKey: Modifier key used in combination with hotkeys (default: LeftShift). Options: Shift, Control, Alt, LeftShift, RightShift, LeftControl, RightControl, LeftAlt, RightAlt, None.
  • DefaultRadius: Capture radius in meters for the fallback area save (default: 5.0).
  • PlacementBatchSize: Number of pieces placed per frame during batched building (default: 10). Lower values reduce stuttering on slower hardware.
  • MaxUndoHistory: How many recent placements are kept in the undo history (default: 5).

CHANGELOG

Changelog

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.
    • UndoHotkey (default: Shift+U) — Hotkey to open the manager to the Undo tab.
    • ModifierKey (default: LeftShift) — Modifier key used in combination with hotkeys. Options: Shift, Control, Alt, LeftShift, RightShift, LeftControl, RightControl, LeftAlt, RightAlt, None.

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.