Legendary, Shinies, Bosses, and Custom targets could be set for this system.
Legendary function with a timer that every time the timer runs out a 30% chance for a legend to spawn happens. In this case that legend could persist where it spawns until the next spawn chance happens if you haven't bothered to go get it by then.
Shinies have a severely low chance of spawning without lures, end game help, or ultra space. When you see a shiny despawn it is tragic. With this you could assign an amount of time they stick around for within their registered chunk until it runs out or you find them. Bosses and Custom targets would be the same.
Config Settings:
Number of Legends allowed to persist =
Minutes before despawn legend =
Number of Shinies allowed to persist =
Minutes before despawn shiny =
Number of Bosses allowed to persist =
Minutes before despawn Bosses =
Number of Custom Targets allowed to persist =
Minutes before despawn Custom Targets =