mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-28 22:47:41 +02:00
Remove passengers at death
This commit is contained in:
parent
14e9dcb811
commit
9df6b19f1d
@ -171,6 +171,11 @@ public abstract class LivingEntity extends Entity implements EquipmentHandler {
|
|||||||
// Reset velocity
|
// Reset velocity
|
||||||
velocity.zero();
|
velocity.zero();
|
||||||
|
|
||||||
|
// Remove passengers if any
|
||||||
|
if (hasPassenger()) {
|
||||||
|
getPassengers().forEach(entity -> removePassenger(entity));
|
||||||
|
}
|
||||||
|
|
||||||
EntityDeathEvent entityDeathEvent = new EntityDeathEvent(this);
|
EntityDeathEvent entityDeathEvent = new EntityDeathEvent(this);
|
||||||
callEvent(EntityDeathEvent.class, entityDeathEvent);
|
callEvent(EntityDeathEvent.class, entityDeathEvent);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user