Hello! I'm currently working on a dungeon plugin. At the beginning, the mobs are created using a dungeon.load() method (Dungeon is a custom type I use). The Players are teleported into the dungeon, and then the mobs should be spawned. But that is not the case. For a reason, the mobs are removed all the time! If I load the Dungeon.load() method manually using a command from a location directly in the dungeon, the mobs will spawn correctly. But if I use the method just after the players have been teleported, they will all despawn! Any ideas how to fix that? Is there something like EntityDespawnEvent? Or is EntityDeathEvent also thrown? Help me please!
The entity class should have a method like keeploaded or despawn, with a boolean as a argument. Try using that