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
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user