The Essence imprisoned beast is indeed one edge case that does have to be handled correctly.
For alive beast processing, the reason the current code bugs out is because IsActive is not used to check if the current monster is "active". IsValid only does a check to make sure the object's BaseAddress is not 0, so it's not useful for most normal code. Storing the monster's ID and looking up the object on next frame is more desired, but if the current object caching works it should be ok, but not really advised most of the time because of how memory works.
"IsActive" checks the following in the API:
Code:
Reaction == Reaction.Enemy && !IsDead && IsTargetable && !Invincible && !IsHidden;
Certain monsters that "emerge" from the ground, from a statue like state, or from the air actually have two metadata objects for the monster itself. For example,
[81] Gravel Eater | Metadata/Monsters/SandSpitterEmerge/SandSpitterEmergeStandard
has a parent pointer that points to this entry
[68] Gravel Eater | Metadata/Monsters/SandSpitters/SandSpitter1
The Bestiary API does the net check like the game does and handles the lookup correctly for the parent type, but this brings about the core issue at hand.
If you were only check IsActive, you'd miss processing the submerged monster because it's not active in that state. It only becomes active once you trigger it by proximity, and then the metadata of the monster that appears is different.
So simply checking IsActive when really close to the monster will avoid a stuck issue, but if Monolith logic isnt allowed to run, then it'll always be stuck there until it times out.
You'll have to borrow some code from Monoliths to process them correctly before trying to net them, but I'll look at adding support to the Monster API for something like an IsImprisoned check that will check against monolith data so you the issue can be avoided more easily. Up until now, there's been no use in knowing if a monster was imprisoned since you either were going to hit the monolith, or the monsters trapped were already being ignored since they were not active.
Later on, we can also do some minor Bestiary updates to the Monoliths plugin, as before the only thing that really could affect them was a Tormented Spirit, so this is just an example of how the game dynamics can change with new league mechanics.