mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2025-12-06 06:41:44 +00:00
only check livingentities
This commit is contained in:
@@ -55,6 +55,9 @@ public class EntityDamage implements Listener {
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void onDamage(EntityDamageByEntityEvent event) {
|
public void onDamage(EntityDamageByEntityEvent event) {
|
||||||
|
if (!(event.getEntity() instanceof LivingEntity)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
LivingEntity livingEntity = (LivingEntity) event.getEntity();
|
LivingEntity livingEntity = (LivingEntity) event.getEntity();
|
||||||
// mob is going to die
|
// mob is going to die
|
||||||
if (livingEntity.getHealth() - event.getFinalDamage() <= 0) {
|
if (livingEntity.getHealth() - event.getFinalDamage() <= 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user