mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-07 13:15:02 +00:00
ignore void and /kill damage
This commit is contained in:
@@ -53,6 +53,13 @@ public class EntityDamage implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
LivingEntity livingEntity = (LivingEntity) event.getEntity();
|
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
|
// mob is going to die
|
||||||
if (livingEntity.getHealth() - event.getFinalDamage() <= 0) {
|
if (livingEntity.getHealth() - event.getFinalDamage() <= 0) {
|
||||||
// a player is killing something
|
// a player is killing something
|
||||||
|
|||||||
Reference in New Issue
Block a user