From fe7337fc1020bacb2a35f8d356e4ff6b26de979a Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 24 Apr 2017 18:20:14 +0200 Subject: [PATCH] Set health before entity death. By: Lukas Hennig --- .../java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index 27cd0d43df..5fbd124716 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -99,11 +99,11 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { throw new IllegalArgumentException("Health must be between 0 and " + getMaxHealth() + "(" + health + ")"); } + getHandle().setHealth((float) health); + if (health == 0) { getHandle().die(DamageSource.GENERIC); } - - getHandle().setHealth((float) health); } public double getMaxHealth() {