Remove passengers at death

This commit is contained in:
Felix Cravic 2020-05-25 21:14:28 +02:00
parent 14e9dcb811
commit 9df6b19f1d

View File

@ -171,6 +171,11 @@ public abstract class LivingEntity extends Entity implements EquipmentHandler {
// Reset velocity
velocity.zero();
// Remove passengers if any
if (hasPassenger()) {
getPassengers().forEach(entity -> removePassenger(entity));
}
EntityDeathEvent entityDeathEvent = new EntityDeathEvent(this);
callEvent(EntityDeathEvent.class, entityDeathEvent);
}