diff options
author | Lukas Hennig <lukas@wirsindwir.de> | 2017-04-24 18:20:14 +0200 |
---|---|---|
committer | md_5 <git@md-5.net> | 2017-05-04 19:18:46 +1000 |
commit | 2b6c9f40aef19b5366a8ecd6bf2bb9900ce3c684 (patch) | |
tree | 408b50bff83a7af137bc858cc4192094ecf2ed52 /src/main/java/org/bukkit | |
parent | fbb47e83831c8a9b0faf0a01855537ca57cdecef (diff) | |
download | craftbukkit-2b6c9f40aef19b5366a8ecd6bf2bb9900ce3c684.tar craftbukkit-2b6c9f40aef19b5366a8ecd6bf2bb9900ce3c684.tar.gz craftbukkit-2b6c9f40aef19b5366a8ecd6bf2bb9900ce3c684.tar.lz craftbukkit-2b6c9f40aef19b5366a8ecd6bf2bb9900ce3c684.tar.xz craftbukkit-2b6c9f40aef19b5366a8ecd6bf2bb9900ce3c684.zip |
Set health before entity death.
Diffstat (limited to 'src/main/java/org/bukkit')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 4 |
1 files 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 27cd0d43..5fbd1247 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/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() { |