From fb392c0cd116781f1ca71262b239580c85efd2d2 Mon Sep 17 00:00:00 2001 From: montlikadani Date: Sun, 14 Jul 2019 19:30:27 +0200 Subject: [PATCH] Fix incorrect entity max health Monster damage option will work again when using the Kill action for jobs. https://github.com/Zrips/Jobs/issues/429#issuecomment-511219013 --- src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java | 2 +- src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java | 2 +- src/main/java/com/gamingmesh/jobs/nmsUtil/v1_14.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java index 623326b5..da2e6256 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_12.java @@ -54,7 +54,7 @@ public class v1_12 implements NMS { @Override public double getMaxHealth(LivingEntity entity) { - return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue(); + return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); } @Override diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java index ab3a4b8e..aaddb278 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_13.java @@ -39,7 +39,7 @@ public class v1_13 implements NMS { @Override public double getMaxHealth(LivingEntity entity) { - return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue(); + return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); } @Override diff --git a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_14.java b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_14.java index 239ec338..0b61a342 100644 --- a/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_14.java +++ b/src/main/java/com/gamingmesh/jobs/nmsUtil/v1_14.java @@ -39,7 +39,7 @@ public class v1_14 implements NMS { @Override public double getMaxHealth(LivingEntity entity) { - return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue(); + return entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getBaseValue(); } @Override