package de.craften.plugins.managedentities;

import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDeathEvent;

class EntityListener implements Listener {
    private final EntityManager entityManager;

    public EntityListener(EntityManager entityManager) {
        this.entityManager = entityManager;
    }

    @EventHandler
    public void onEntityDeath(EntityDeathEvent event) {
        ManagedEntity entity = entityManager.getEntity(event.getEntity());
        if (entity instanceof ManagedEntityBase) {
            ((ManagedEntityBase) entity).onDeath();
        }
    }
}

@@ -72,24 +72,63 @@
 entHandler;%0A
+import org.bukkit.event.EventPriority;%0A
 import org.b
@@ -415,16 +415,50 @@
 tHandler
+(priority = EventPriority.MONITOR)
 %0A    pub

Set priority of entity death listener to monitor. Fixes #3.