From 83a9dbdef609f7e8dfd4c0a5758be72fe732d8c9 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 30 Jul 2016 10:06:07 +1000 Subject: [PATCH] SPIGOT-2559: Kill all entities when called with setHealth(0) --- .../java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index e662e4ae25..feef438c34 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -95,8 +95,8 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth()); } - if (entity instanceof EntityPlayer && health == 0) { - ((EntityPlayer) entity).die(DamageSource.GENERIC); + if (health == 0) { + getHandle().die(DamageSource.GENERIC); } getHandle().setHealth((float) health);