ImmortalPortals

版本 v0.1.0·更新於 2026-09-15

讓原版木/石傳送門免疫一切傷害(怪物、火焰、雪災、火山灰、支撐坍塌),建造錘仍可拆除。Immortal Portals: vanilla wood/stone portals are immune to all damage (monsters, fire, snow, ash, support loss) yet still removable with the build hammer.

模組介紹 作者原文

Immortal Portals

A tiny Valheim mod: the two vanilla portals (wood and stone) become immune to all damage — monsters, players, fire, snow, ash and support collapse can no longer destroy them. The build hammer still removes them normally.

Localization: English / Simplified Chinese / Traditional Chinese

Features

  • Both vanilla portals protected: portal_wood (Portal) and portal_stone (Stone portal).
  • Immune to every damage path:
  • monster and player attacks, projectiles, fire, AoE explosions;
  • environmental wear: support collapse, Deep North heavy snow, Ashlands ash and lava, persistent events.
  • Build hammer still works: removal uses a separate code path, so you can always dismantle your portal and get the materials back.
  • Applies immediately to existing saves: no health changes, no save data touched.
  • Modded portal variants (anything using the vanilla TeleportWorld component) are protected too — configurable.

How It Works

All damage to a buildable piece funnels into WearNTear.ApplyDamage (attack damage via RPC_Damage, environmental wear via UpdateWear). The mod Harmony-patches that single method and skips it for portals. Hammer removal goes through WearNTear.Remove → RPC_Remove → Destroy, which never touches ApplyDamage, so it keeps working.

Configuration

File: BepInEx/config/trigger.valheim.immortalportals.cfg (ConfigurationManager supported).

| Section | Key | Default | Description |

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

| General | Enabled | true | Master switch |

| General | ProtectWoodPortal | true | Protect the wooden portal (portal_wood) |

| General | ProtectStonePortal | true | Protect the stone portal (portal_stone) |

| General | ProtectOtherPortals | true | Protect other portals using the vanilla TeleportWorld component (modded variants) |

| General | DebugLog | false | Log blocked damage (troubleshooting) |

Installation

  • Install BepInExPack for Valheim.
  • Drop ImmortalPortals.dll into BepInEx/plugins/ImmortalPortals.

Multiplayer

Damage is decided by the object's owner (host / dedicated server). Install the mod on the server to guarantee protection; clients should install it too so every player sees the same behavior.

Build

cd ImmortalPortals

dotnet build.\ImmortalPortals.csproj -c Release

Output: BepInEx/plugins/ImmortalPortals/ImmortalPortals.dll (output path is preconfigured).

Repository

簡體中文

一個小型 Valheim 模組:原版兩種傳送門(木門 / 石門)免疫一切傷害——怪物、玩家、火焰、雪災、火山灰與支撐坍塌都無法再摧毀它們;建造錘拆除照常可用。

  • 兩種原版傳送門全覆蓋:portal_wood(傳送門)與 portal_stone(石制傳送門)。
  • 免疫所有傷害路徑:
  • 怪物與玩家攻擊、投射物、火焰、AoE 爆炸;
  • 環境磨損:無支撐坍塌、深北雪災、火山灰與岩漿、持久事件。
  • 建造錘仍可拆除:拆除走獨立代碼路徑,隨時可以拆掉傳送門並回收材料。
  • 老存檔立即生效:不改血量、不寫存檔數據。
  • 模組傳送門變體(使用原版 TeleportWorld 組件)同樣受保護,可配置。

原理:建築受到的所有傷害最終都匯聚到 WearNTear.ApplyDamage(攻擊傷害經 RPC_Damage,環境磨損經 UpdateWear)。本模組只 Harmony 攔截這一個方法,對傳送門直接跳過;建造錘拆除走 WearNTear.Remove → RPC_Remove → Destroy,不經過該方法,因此不受影響。

| 配置項 | 默認 | 說明 |

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

| Enabled | true | 總開關 |

| ProtectWoodPortal | true | 保護木製傳送門 |

| ProtectStonePortal | true | 保護石制傳送門 |

| ProtectOtherPortals | true | 保護其他使用原版 TeleportWorld 組件的傳送門變體 |

| DebugLog | false | 輸出被攔截的傷害日誌(排查用) |

聯機:傷害由對象歸屬者(主機 / 專用服務器)判定,服務端安裝才能保證保護生效;客戶端也建議安裝,表現一致。

繁體中文

一個小型 Valheim 模組:原版兩種傳送門(木門 / 石門)免疫一切傷害——怪物、玩家、火焰、雪災、火山灰與支撐坍塌都無法再摧毀它們;建造錘拆除照常可用。

  • 兩種原版傳送門全覆蓋:portal_wood(傳送門)與 portal_stone(石製傳送門)。
  • 免疫所有傷害路徑:
  • 怪物與玩家攻擊、投射物、火焰、AoE 爆炸;
  • 環境磨損:無支撐坍塌、深北雪災、火山灰與巖漿、持久事件。
  • 建造錘仍可拆除:拆除走獨立程式路徑,隨時可以拆掉傳送門並回收材料。
  • 舊存檔立即生效:不改血量、不寫存檔資料。
  • 模組傳送門變體(使用原版 TeleportWorld 元件)同樣受保護,可設定。

原理:建築受到的所有傷害最終都匯聚到 WearNTear.ApplyDamage(攻擊傷害經 RPC_Damage,環境磨損經 UpdateWear)。本模組只 Harmony 攔截這一個方法,對傳送門直接跳過;建造錘拆除走 WearNTear.Remove → RPC_Remove → Destroy,不經過該方法,因此不受影響。

連線:傷害由物件歸屬者(主機 / 專用伺服器)判定,伺服器安裝才能保證保護生效;客戶端也建議安裝,表現一致。

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
ImmortalPortals-0.1.0.zip
檔案大小
55.0 KiB