Noticed this when debugging why unloaded worlds were remaining in memory
Tried everything possible to unregister, despawn pets on world unload but was having no luck.
I fixed this by making ActiveMob a weak reference, but you should also be able to fix this by nullifying activeMob when it is removed (this is currently not possible via API, setActiveMob(null) will just call despawn instead.
Paper Version: 1.21.4
Mythic, ModelEngine & MCPets version: latest dev builds