DrakosDJ-PrefabHammer 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.

Last updated 5 days ago
Total downloads 1420
Total rating 3 
Categories Mods Misc Client-side Utility Building AI Generated
Dependency string DrakosDJ-PrefabHammer-1.1.6
Dependants 1 other package depends on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2202 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured and includes unstripped Unity DLLs.

Preferred version: 5.4.2202

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.
  • Selection Clearing: Hold Shift or Control while pressing the select key (J), or press the select key while aiming at empty air, to instantly clear all selected pieces.
  • 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, /prefabdelete, /prefabinspectorigin, and /prefabcleanorigin.

Compatibility with MovingDay

If you also have the MovingDay mod installed, they will automatically work together:

  • Shared Selection: They share the exact same selection pool in memory. Highlighting a structure with PrefabHammer's select keys will immediately make it targetable by MovingDay's move keys, and vice versa.
  • Coordinated Highlights: Selecting pieces in one mod keeps them visually highlighted, and clearing the selection in either mod cleans up both mods' highlight overlays.

Keybinds (Configurable)

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

Chat Commands

  • /prefabsave [name] [radius]: Save the hovered structure (or current selection) as a new blueprint.
  • /prefablist or /prefablibrary: Open the Prefab Manager to the Library tab.
  • /prefabreload: Reload custom blueprints from disk.
  • /prefabdelete [name]: Delete a saved blueprint by name.
  • /prefabinspectorigin [radius]: Inspect and categorize all entities near world origin (0, 0, 0) with their exact distances in meters.
  • /prefabcleanorigin [radius]: Clean up orphaned dummy containers, loose item drops, or standard building pieces near world origin (0, 0, 0). Note: Also sweeps up standard building pieces within 5m of the altar.

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 the in-game Configuration Manager / r2modman's Config Editor).

General

  • Enabled: Enable or disable the mod on the fly (default: true).
  • 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.
  • DefaultRadius: Capture radius in meters for the fallback area save (default: 5.0).

Keybinds

All hotkeys use BepInEx's native click-to-bind system. In the in-game configuration manager, click the keybind button and press the key combination you want — no need to type key names.

  • SaveHotkey: Open the save panel (default: K).
  • SelectHotkey: Toggle piece selection (default: J).
  • ManagerHotkey: Open the Prefab Manager to the Library tab (default: Left Shift + K).
  • UndoHotkey: Open the Prefab Manager to the Undo History tab (default: Left Shift + U).

Performance

  • 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).

Upgrading from v1.0.7 or earlier: Delete your old com.prefabhammer.cfg file to let BepInEx regenerate it with the new keybind format. The old string-based key entries are not compatible.

Discord

Join our Discord Server for discussion, suggestions, and bug reports!