FocusGuard
Stops refocus clicks from becoming attacks, blocks, build-menu actions, or removals. Because your tamed pig has suffered enough.
模組介紹 作者原文
FocusGuard 1.0.1
Tired of accidentally punching your pig just because you clicked back into Valheim?
FocusGuard prevents the mouse click used to refocus Valheim from becoming an attack, block, or alternate attack. Release the mouse button and your controls immediately return to normal—no lasting combat delay and no extra interface to manage.
Installation
Install with a mod manager, or place FocusGuard.dll in the profile's BepInEx/plugins/FocusGuard folder.
Configuration
The configuration file is created at BepInEx/config/maddcatter.focusguard.cfg after the game starts once.
- Enabled — master switch; default true.
- GuardLeftClick — protects attack/tool input; default true.
- GuardRightClick — protects block input; default true.
- GuardAlternateAttack — protects middle-click alternate attacks; default true.
- SafetyWindow — short fallback in seconds; default 0.15, range 0–0.5.
Building
Set ValheimManagedDir to Valheim's managed assemblies folder and BepInExCoreDir to the active BepInEx core folder, then build the project in Release mode. These paths can be supplied through the VALHEIM_MANAGED and Valheim_BepInEx_Core environment variables used by the project.
What It Protects
- Left click: attacks and tool swings.
- Right click: blocking and build/mode menu input.
- Middle click: alternate attacks and building-piece removal.
FocusGuard is client-side only and does not need to be installed on the server.
Support
For help, bug reports, or compatibility feedback, visit the MaddCatter mod support Discord.
Changelog
1.0.1
- Fixed the first protected refocus click occasionally slipping through at the start of a new game session.
- Right-click refocus no longer opens the build/mode menu while using tools such as the hammer, hoe, or cultivator.
- Middle-click refocus no longer removes highlighted building pieces while using the hammer.
- Added protection for Valheim's BuildMenu, Remove, and mouse-button release input paths.
1.0.0
- Initial release.
- Guards attack, block, and alternate-attack mouse inputs when Valheim regains focus.
- Tested in fullscreen and windowed display modes.
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: