AutoCloseDoors

版本 v0.1.9·更新於 2026-07-21

Owner-safe automatic closing for Valheim doors and gates, with network deadlines, configurable radius/delay, dungeon behavior, and player-door sensor blocking.

模組介紹 作者原文

AutoCloseDoors

Lightweight Valheim/BepInEx mod that closes opened doors and gates after a configurable delay, but only when no player is near the door. Autoclosing can be disabled for doors located inside dungeons/interiors and is disabled there by default.

Behavior

  • Stores each open door's close deadline in its networked ZDO and tracks only doors that are currently open.
  • Uses one central coroutine that sleeps until the next tracked door is due; there is no per-frame Update/tick patch.
  • Checks all players with Valheim's own Player.IsPlayerInRange.
  • Lets only the current ZDO owner evaluate and close a due door. The close-only RPC is idempotent and writes only the closed state, so a delayed request cannot toggle a newly reopened door.
  • Re-checks the replicated deadline, player radius, dungeon location, door state, and vanilla interaction state immediately before closing.
  • Respects Valheim's inverted door-state flag used by one-way showcases, secret bookcases, and other custom doors where network state 0 means visually open.
  • Keeps the original ZDO owner instead of claiming ownership, and uses the door's normal state refresh for animation and close effects.
  • Treats every door leaf independently, so nearby unrelated doors cannot inherit another door's deadline or player-radius result. Double doors naturally work as two networked leaves.
  • Skips doors located in dungeons/interiors by default, with a config toggle to enable them.
  • Skips keyed doors and doors that vanilla marks as unable to close.
  • Can block compatible monster-door sensor mods from opening player-built doors for monsters while leaving world-generated doors unchanged.

Config

Generated by BepInEx at:

BepInEx/config/obelisk.valheim.autoclosedoors.cfg

Options:

  • Enabled: enable/disable the mod.
  • Enable in dungeons: enable/disable automatic closing for doors located inside dungeons/interiors. Disabled by default.
  • Player radius: radius around each door leaf that keeps it open.
  • Close delay seconds: delay before closing, clamped by config range from 2 to 10.
  • Block monster door sensors: prevents compatible door sensor mods from opening player-built doors for monsters. Enabled by default.

Multiplayer

The close deadline and door state are stored in the door's ZDO. Every modded peer observes the replicated deadline, while only the current ZDO owner may reschedule or close the door. This keeps ownership changes safe and prevents multiple clients from toggling the same door. Install the same mod version and use the same scheduling config on the server and every client: the current ZDO owner evaluates the delay, radius, and door-state rules.

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
AutoCloseDoors-0.1.9.zip
檔案大小
141.8 KiB