mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-01 05:58:00 +01: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
|
||||
velocity.zero();
|
||||
|
||||
// Remove passengers if any
|
||||
if (hasPassenger()) {
|
||||
getPassengers().forEach(entity -> removePassenger(entity));
|
||||
}
|
||||
|
||||
EntityDeathEvent entityDeathEvent = new EntityDeathEvent(this);
|
||||
callEvent(EntityDeathEvent.class, entityDeathEvent);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user