NoAFKRaids

v2.0.0·Updated 2026-01-11

Prevents raids from starting near players that are AFK.

About this mod Author’s original text

No AFK Raids

Version 2.0.0 - Complete rewrite! Now extremely lightweight. If upgrading from 1.x, you may want to delete your server's old config file.

Prevents raids from occurring within 200 meters (configurable) of an AFK player.

  • Players are considered AFK after three minutes of inactivity (configurable)
  • Crossplay compatible
  • ServerSync: Config syncs from server to clients automatically
  • Uses Valheim's native event system for optimal reliability

Installation

Place NoAFKRaids.dll in BepInEx/plugins/

| Scenario | Where to Install |

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

| Singleplayer | Your game only |

| Self-hosted multiplayer | Host + all clients |

| Dedicated server | Server + all clients |

Note: Players without the mod installed won't have their AFK status tracked and won't be protected from raids.

ServerSync

This mod uses ServerSync to synchronize configuration from the server to clients. When ServerConfigLocked = true (default), the server's settings override client settings for gameplay options. Logging preferences remain client-side.

Configuration Options

Config file: BepInEx/config/dumba.noafkraids.cfg

AFK Detection

| Setting | Default | Description |

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

| ServerConfigLocked | true | Server settings override client settings |

| AFKMinutes | 3 | Minutes without movement before considered AFK |

| MovementThreshold | 0.1 | Minimum movement distance to be considered active |

| UpdateInterval | 10 | Seconds between AFK status updates |

Protection

| Setting | Default | Description |

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

| AFKProtectionRadius | 200 | Distance (meters) around AFK players where raids are blocked |

| UseEventRangeAsProtection | false | Use the game's native event range (96m) instead of custom radius |

| AllowForcedEvents | true | Allow boss fights and forced events to proceed (don't block these) |

Logging (Client-Side Only)

| Setting | Default | Description |

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

| LogRaidDecisions | true | Log when raids are blocked or allowed |

| LogAFKStateChanges | false | Log when players go AFK or become active |

| DebugMode | false | Enable verbose debugging output |

How It Works

The mod integrates directly with the event system at the optimal point where raid positions are determined. When a raid attempts to start:

  • The game selects a raid type and target position
  • NoAFKRaids checks if any AFK players are within the protection radius
  • If an AFK player is nearby, the raid is prevented before it begins
  • Active players can still experience raids normally

Why Client-Side AFK Detection?

For better performance on large servers. Server simply maintains a dictionary of AFK states and checks distances when raids occur (rare event).

| Task | Who Does It |

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

| Position monitoring & AFK timers | Each client (distributed load) |

| State change notification | Client → Server via RPC (infrequent) |

| Raid blocking decision | Server (only when raids trigger) |

Contact

Discord - Dumba (dumba7435)

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. 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.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. 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.

Dependencies

Install these first, or the mod will not work:

denikson-BepInExPack_Valheim

File & checksum

Filename
NoAFKRaids-2.0.0.zip
File size
151.9 KiB