mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-11 17:31:06 +01:00
Report valid health when getting Entity health. Fixes BUKKIT-3210
This commit is contained in:
parent
ed6aab8200
commit
4e1793f363
1 changed files with 1 additions and 1 deletions
|
@ -59,7 +59,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHealth() {
|
public int getHealth() {
|
||||||
return getHandle().getHealth();
|
return Math.min(Math.max(0, getHandle().getHealth()), getMaxHealth());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHealth(int health) {
|
public void setHealth(int health) {
|
||||||
|
|
Loading…
Reference in a new issue