FocusGuard
Stops refocus clicks from becoming attacks, blocks, build-menu actions, or removals. Because your tamed pig has suffered enough.
About this mod Author’s original text
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.
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: