StructureHealth

版本 v1.5.1·更新於 2026-05-13

Adds numeric health and predicted stability to the hammer's hover label. Works for the hovered piece in Repair mode and for the placement ghost in Build mode.

模組介紹 作者原文

StructureHealth

A small Valheim mod that adds numeric health and predicted stability to the hammer's hover label — so you stop guessing whether the green cube means "98%" or "31%".

Features

  • Repair mode — hover any built piece, see Health: X / Y and Stability: A / B next to the Repair label.
  • Build mode — select a piece, see the ghost's max health and predicted stability for the current placement spot before you click.
  • Native HUD — writes into Valheim's own hover label. Same font, no extra panels.
  • Colour-coded — values tint green / yellow / red as health and stability drop.
  • Optional IMGUI overlay — toggle a top-left panel with F8.
  • Independent toggles — turn repair or build info off separately.

Install

Requires BepInEx for Valheim.

Via r2modman Mod Manager — subscribe to StructureHealth and launch the game through the manager.

Manual — drop StructureHealth.dll into Valheim/BepInEx/plugins/StructureHealth. Launch the game once to generate the config file.

Configuration

Edit BepInEx/config/com.lubert.valheim.structurehealth.cfg directly, or use ConfigurationManager in-game.

| Setting | Default | What it does |

| --- | --- | --- |

| EnableRepairInfo | true | Show stats of the hovered piece in Repair mode. |

| EnableBuildInfo | true | Show predicted stats for the placement ghost. |

| ShowOverlayPanel | false | Also draw a parallel IMGUI panel in the top-left corner. |

| UseRichText | true | Rich-text colouring in the hover label. |

| HoverFontSize | 18 | Font size for the hover info (0 = inherit Valheim's default). |

| OverlayFontSize | 16 | Font size for the IMGUI overlay. |

| ToggleOverlayKey | F8 | Hotkey to toggle the overlay panel. |

How the prediction works

For real placed pieces, the mod reads WearNTear.GetSupport() directly — the same number Valheim uses internally.

The placement ghost has no valid ZNetView, so UpdateSupport() would NRE and GetSupport() would short-circuit to GetMaxSupport(). A Harmony transpiler null-safes the ZNetView accesses inside UpdateSupport and bypasses an early-exit that fires when the support-scan loop hits a non-WearNTear collider — letting the native algorithm produce the same number you'd see right after placing the piece. A directional physics-scan heuristic stays in as a fallback if anything ever blows up unexpectedly.

Build from source

dotnet build StructureHealth.csproj -c Release

Requires.NET SDK 9, Valheim installed at the default Steam path, and BepInEx already deployed there. The post-build step copies the DLL into BepInEx/plugins/StructureHealth/ automatically.

Project layout:

src/

├── Plugin.cs # plugin entry + config bindings

├── Helpers.cs # TextStyle, PieceNames, cached reflection, SafeNView

├── Strings.cs # localised labels (English, Ukrainian)

├── Inspection.cs # WearNTearInfo, GhostSupport, HoverFormatter

├── Patches.cs # Harmony patches (Highlight, UpdateCrosshair, UpdateSupport)

└── OverlayRenderer.cs # optional IMGUI panel

License

MIT.

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
StructureHealth-1.5.1.zip
檔案大小
16.0 KiB