From f1cc082ee03cfcfc28afe9b462b5f70e3e8ff2f0 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sun, 23 Dec 2012 07:16:59 -0600 Subject: [PATCH] Report valid health when getting Entity health. Fixes BUKKIT-3210 By: feildmaster --- .../java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java index ee41c37b08..f2f43466e4 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftLivingEntity.java @@ -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) {