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 bd00911b35..da7a2af90d 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 @@ -19,6 +19,7 @@ import net.minecraft.server.EntitySnowball; import net.minecraft.server.EntityPlayer; import net.minecraft.server.EntityPotion; import net.minecraft.server.EntityWitherSkull; +import net.minecraft.server.GenericAttributes; import net.minecraft.server.MobEffect; import net.minecraft.server.MobEffectList; import net.minecraft.server.Packet42RemoveMobEffect; @@ -83,13 +84,13 @@ public class CraftLivingEntity extends CraftEntity implements LivingEntity { } public double getMaxHealth() { - return getHandle().maxHealth; + return getHandle().getMaxHealth(); } public void setMaxHealth(double amount) { Validate.isTrue(amount > 0, "Max health must be greater than 0"); - getHandle().maxHealth = (float) amount; + getHandle().a(GenericAttributes.a).a(amount); if (getHealth() > amount) { setHealth(amount);