mirror of
https://github.com/PaperMC/Paper.git
synced 2025-03-15 12:02:49 +01:00
SPIGOT-2559: Kill all entities when called with setHealth(0)
This commit is contained in:
parent
8cc5958404
commit
83a9dbdef6
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue