Set health before entity death.

By: Lukas Hennig <lukas@wirsindwir.de>
This commit is contained in:
CraftBukkit/Spigot 2017-04-24 18:20:14 +02:00
parent 8803cfc46a
commit fe7337fc10

View file

@ -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() {