NoAFKRaids

版本 v2.0.0·更新於 2026-01-11

Prevents raids from starting near players that are AFK.

模組介紹 作者原文

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)

安裝與使用 安裝:BepInEx 外掛

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

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

前置依賴

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

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
NoAFKRaids-2.0.0.zip
檔案大小
151.9 KiB