only check livingentities

This commit is contained in:
hyperdefined
2022-01-30 16:02:26 -05:00
parent 8736519d34
commit 7bc5af2a58

View File

@@ -55,6 +55,9 @@ public class EntityDamage implements Listener {
@EventHandler
public void onDamage(EntityDamageByEntityEvent event) {
if (!(event.getEntity() instanceof LivingEntity)) {
return;
}
LivingEntity livingEntity = (LivingEntity) event.getEntity();
// mob is going to die
if (livingEntity.getHealth() - event.getFinalDamage() <= 0) {