
If you'd like a mod that does basically this, but for 26.x Fabric / NeoForge, I recommend Depillage by pajic
For 1.20.1 Forge mod, I suggest you check out Pillager Redux Extended by AliceTheKitsune
The Problem
What bothered me since 1.14, was the fact, that some structures like pillager outposts or ocean monuments keep respawning mobs forever — you couldn't really keep a structure for yourself nor even destroy it if you've wanted to.
The Fix
Structures Are Not Spawners (SANS for short) changes this behaviour.
Now, when you kill enough enemies spawned by the structure, it will stop spawning new mobs for good.
You can actually take that outpost for yourself! (Or burn it down if you want to)
By default it affects two structures:
Pillager Outposts – 10 kills required
Ocean Monuments – 20 kills required
Compatibility
Supports structures added by Repurposed Structures, Terralith and Town and Towers.
To add your own structures, go to config (either in-game or through file explorer) and add new rules according to provided template.
If you'd like me to add support, open an issue on GitHub.
Performance
I tried my best to make this mod as light on resources as possible. I've done six tests with spark profiler – overall SANS's impact should be none-to-minimal, provided you stay within sensible detection ranges. (96 blocks default).
The mod is safe to add and remove mid-save. Upon removal, structures will have their vanilla behaviour again.
Mods appearing in Gallery screenshots are Terralith, Oh Biomes We've Gone, Scorched Guns Neoforged, Scorched Guns: Blistering Armor and Distant Horizons.

