zoltan-EnemyLeash icon

EnemyLeash

Monsters give up the chase instead of following you across the entire map.

By zoltan
Last updated 12 hours ago
Total downloads 49
Total rating 0 
Categories Mods Server-side AI Generated
Dependency string zoltan-EnemyLeash-1.0.0
Dependants 0 other packages depend on this package

This mod requires the following mods to function

BepInEx-BepInExPack-5.4.2100 icon
BepInEx-BepInExPack

BepInEx pack for Mono Unity games. Preconfigured and ready to use.

Preferred version: 5.4.2100

README

EnemyLeash

Monsters give up instead of following you across the whole map.

Built and compiled against game build v0.4.4 (Cosmetics Update line).

What it does

When a chase begins, the mod drops an invisible anchor at the enemy's position. If that enemy travels further than LeashRadius from the anchor, it gives up, turns around, and can't start a new chase for GiveUpCooldown seconds.

The give-up uses Enemy.DisableChase() — the game's own "stop chasing" call — so the state machine unwinds naturally rather than being forced into a state by hand. Optionally it also blinds the enemy for the cooldown, otherwise it will just hear you and start investigating again immediately.

Hooks EnemyStateChase.Update, the per-frame tick every chasing enemy runs, so it covers all vanilla monsters and most modded ones built on the same Enemy component.

Host only

Chase state is authoritative on the master client and the result propagates through the game's own sync. Nothing is patched client-side, so there's no desync risk and clients don't need the mod.

Config

BepInEx/config/benjamin.enemyleash.cfg

Key Default Notes
Enabled true Master switch
LeashRadius 30 Metres from where the chase started. 0 disables distance leashing
MaxChaseSeconds 0 Hard cap on chase duration. 0 disables. Only ever shortens vanilla's own per-type timers
GiveUpCooldown 8 Seconds before the enemy can chase again
BlindOnGiveUp true Also blind it for the cooldown, so it doesn't just re-investigate
Verbose false Logs each leash with the distance and duration that triggered it

Tuning notes

30m is roughly two or three rooms — enough that a chase still feels dangerous, short enough that you can actually break line of sight and reset. Drop to 15 for a much softer game; push to 60+ if you only want to stop the truly absurd cross-map pursuits.

GiveUpCooldown matters more than it looks. At 0 the enemy often re-acquires you within a second and the leash appears to do nothing. 8 seconds is enough to actually get away.

The anchor is where the chase started, not where the enemy spawned, so a monster that has roamed halfway across the level still gets a full leash length from that point.

Building

Requires .NET SDK 8.0+. Add the NuGet feeds in nuget.config, then:

dotnet build -c Release

Output lands in bin/Release/netstandard2.1/EnemyLeash.dll. Drop it in BepInEx/plugins/.