mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Set health before entity death.
By: Lukas Hennig <lukas@wirsindwir.de>
This commit is contained in:
parent
8803cfc46a
commit
fe7337fc10
1 changed files with 2 additions and 2 deletions
|
@ -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() {
|
||||
|
|
Loading…
Reference in a new issue