Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
PersistentRaids
Raid creatures hunt and persist after the HUD. Open-world mobs stay vanilla. Per-raid Custom Raids durations untouched unless you opt in.
| Date uploaded | 2 weeks ago |
| Version | 1.0.10 |
| Download link | cjayride-PersistentRaids-1.0.10.zip |
| Downloads | 115 |
| Dependency string | cjayride-PersistentRaids-1.0.10 |
This mod requires the following mods to function
denikson-BepInExPack_Valheim
BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.
Preferred version: 5.4.2360README
⚔️ PersistentRaids
Make Valheim raids more persistent, aggressive, and dangerous.
1.0.10
- Verified against Valheim 1.0.21 (Steam build 26249040). BepInEx dependency:
denikson-BepInExPack_Valheim-5.4.2360. - Faster raid AI / cap / timeout paths so wildlife and idle servers pay less CPU.
PersistentRaids is a BepInEx mod that keeps raid and event creatures hunting players with extended sight and persistent behavior. Normal open-world creatures retain vanilla behavior, so wildlife won't permanently accumulate around your bases.
Custom Raids remains responsible for deciding when raids begin. PersistentRaids handles the creatures after they spawn.
✨ Features
- Persistent Raid Creatures — Raid and event monsters won't despawn simply because players move away.
- Extended Detection Range — Raid creatures can spot and pursue players from farther away.
- Aggressive AI — Raid creatures are kept in hunt and alert states instead of fleeing or wandering aimlessly.
- Configurable Monster Limits — Control the number of active raid creatures server-wide, around players, or both.
- Stuck Raid Protection — Automatically ends random events that remain active after players leave the event area for too long.
- Vanilla Wildlife Behavior — Normal world spawns aren't affected by raid persistence or extended detection.
- Server-Side Cleanup Commands — Manage raid creatures and recover from stuck events.
⚠️ Important Compatibility Settings
Do not enable Expand World Events' Multiple events feature.
Keep the following setting disabled:
AllowMultipleRaids = false
Custom Raids controls when raids start. PersistentRaids preserves raid creatures and helps manage their behavior; it does not need to take over raid scheduling.
📦 Installation
- Install BepInEx for Valheim.
- Install PersistentRaids on the dedicated server and every client.
- Start the game or server to generate the configuration file.
- Review the configuration before adjusting monster limits or raid timeout settings.
Configuration file:
BepInEx/config/cjayride.PersistentRaids.cfg
⚙️ Monster Limits & Performance
Persistent creatures are written to the world save using ZDO.Persistent. This prevents normal zone unloading from removing them, but it also means creatures can accumulate if left unmanaged.
Keep the monster cap enabled to help control performance and prevent excessive creature buildup.
| Setting | Default | Description |
|---|---|---|
MaxActiveMonsters |
60 |
Maximum active raid creatures for the default server-wide cap scope. |
CapScope |
ServerWide |
Choose ServerWide, PerPlayerArea, or Both. |
MaxPerPlayerArea |
40 |
Maximum raid creatures per player area. |
PlayerAreaRadius |
200 |
Radius around players, in meters, for the per-player-area cap. |
| Cap check interval | 2 minutes |
How often the monster cap is enforced. |
OnlyApplyWhilePlayersOnline |
— | Disables persistence while the server is empty, allowing zones to unload. |
When a cap is exceeded, the mod prioritizes removing excess raid creatures furthest from players. Tames, ordinary wildlife, normal spawns, and bosses are excluded from the raid-creature cap.
⏱️ Stuck Raid Protection
Custom Raids can pause an event when nobody is inside its event area. If everyone sails away, the event timer may freeze and prevent another raid from starting.
PersistentRaids includes RaidTimeout, enabled by default, to recover from this situation.
| Setting | Default | Description |
|---|---|---|
EndEventAfterNoPlayersInAreaMinutes |
25 |
End the random event after this many real minutes without players in its area. |
MaxRaidWallClockMinutes |
90 |
End the random event after this many real minutes since it started. |
Set either timeout value to 0 to disable that rule.
Ending an event does not automatically kill its surviving monsters. They remain unless you remove them separately.
🛠️ Server Commands
Run these commands from the server console.
| Command | Description |
|---|---|
persistraid clear |
Destroy non-boss enemies. |
persistraid event |
Destroy event and raid creatures. |
persistraid stop |
Clear a stuck current random event so another raid can start. |
persistraid cap |
Immediately enforce MaxActiveMonsters. |
persistraid boss <prefab> |
Destroy bosses matching the specified prefab name. |
🧠 Raid Behavior & Compatibility
- Raid creatures receive extended sight and persistent hunting behavior.
- Raid AI is reinforced to prevent fleeing, losing aggression, or clearing its hunt state.
- Persistence applies to raid/event creatures, not ordinary open-world wildlife.
- Boss persistence can be configured separately with
NeverDespawnBosses. - Per-raid Custom Raids durations remain in control by default. Optional duration overrides are available if explicitly enabled.
CHANGELOG
Changelog
1.0.10
- Faster raid AI patches, cached filters, tracked raid ZDOs for the cap, and 1 Hz raid-area timeout.
- Re-verified against Valheim 1.0.21 (Steam build 26249040).
1.0.9
- Verified against Valheim 1.0.21 (Release build, Steam build 26249040).
- BepInEx dependency set to
denikson-BepInExPack_Valheim-5.4.2360.
1.0.8
- RaidTimeout: End the random event when nobody is in the event area for 25 minutes (configurable), or after 90 minutes wall-clock since start. Unblocks Custom Raids after sailing away. Mobs may remain per
EventMonstersSurviveRaidEnd.
1.0.7
- Raid creature cap counts only raid creatures, from the server's saved records, so it works on a dedicated server. Tames, wildlife, normal spawns, and bosses are never counted or removed.
- New
CapScope:ServerWide(default,MaxActiveMonsters60),PerPlayerArea(MaxPerPlayerArea40 withinPlayerAreaRadius200 m), orBoth. Extras furthest from players are removed first. - Cap check default interval is 2 minutes.
persistraid clearno longer deletes tames.
1.0.6
- ALL raid/event creatures are forced to fight: block flee, block hunt-clear, re-assert hunt+alert every AI tick. Applies to every raid (Greyling, Boar, Neck, Greydwarf, etc.), not only on spawn.
1.0.5
- Raid timers:
ContinueSpawningWithoutPlayersnow defaults off, so each Custom RaidsDurationandPauseIfNoPlayerInAreaapply as written. PersistentRaids no longer forces the event clock by default. - New optional
OverrideRaidDurations+OverrideDurationSeconds(both unused unless you turn the override on). Leave off to keep per-raid durations. - Raid creature AI: event mobs force hunt + alerted, and clear shy flee flags (
fleeIfNotAlerted, unreachable flee, low-health flee). Fixes Greylings milling around instead of fighting.
1.0.4
- Persistence is now raid-only. Never-despawn and
ZDO.Persistentapply only to raid/event creatures (and bosses viaNeverDespawnBosses). - Open-world wildlife (boars, necks, greylings, etc.) culls like vanilla again, so it no longer accumulates around bases. Fixes base-area FPS drops caused by permanent wildlife.
- Raid mobs get persistence when the event flag is set (
SetEventCreature), not blindly onAwake.
1.0.3
- Fix: 1.0.1 treated every event-area check as “a player is here” and could expose a stashed raid as the current event. Custom Raids refuses to start a new raid while
GetCurrentRandomEvent()is set, so raids stopped appearing. AllowMultipleRaidsdefaults to false. Custom Raids owns raid start; this mod persists raid creatures.persistraid stopclears a stuck current/stashed random event.
1.0.2
- Long-range sight, forced hunt, and never-lose-aggro apply only to RandomEvent / raid creatures (
SetEventCreature). - Open-world mobs (boars, greydwarves, and other non-raid spawns) keep vanilla view range and aggro.
- Night despawn skip is raid-only.
- World bosses no longer inherit raid hunt from
NeverDespawnBosses(far-despawn persist is unchanged).
1.0.1
- Initial release: raid chase, far-despawn block, extra events, spawn-without-players, monster cap 220.