ignore void and /kill damage

This commit is contained in:
hyperdefined
2022-08-18 10:27:43 -04:00
parent 59d0295b18
commit 05f940026f

View File

@@ -53,6 +53,13 @@ public class EntityDamage implements Listener {
return;
}
LivingEntity livingEntity = (LivingEntity) event.getEntity();
// ignore void and /kill damage
EntityDamageEvent.DamageCause cause = event.getCause();
if (cause == EntityDamageEvent.DamageCause.SUICIDE || cause == EntityDamageEvent.DamageCause.VOID) {
return;
}
// mob is going to die
if (livingEntity.getHealth() - event.getFinalDamage() <= 0) {
// a player is killing something