Report valid health when getting Entity health. Fixes BUKKIT-3210
By: feildmaster <admin@feildmaster.com>
This commit is contained in:
@@ -59,7 +59,7 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity {
|
||||
}
|
||||
|
||||
public int getHealth() {
|
||||
return getHandle().getHealth();
|
||||
return Math.min(Math.max(0, getHandle().getHealth()), getMaxHealth());
|
||||
}
|
||||
|
||||
public void setHealth(int health) {
|
||||
|
||||
Reference in New Issue
Block a user