Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit 10b722e

Browse files
committed
fix: max health method
1 parent dab3e7b commit 10b722e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/org/alvindimas05/lagassist/utils/VersionMgr.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,12 @@ public static double getMaxHealth(LivingEntity ent) {
173173
return ent.getMaxHealth();
174174
} else {
175175
try {
176-
return ent.getAttribute((Attribute) Objects.requireNonNull(Reflection.getMethod(Reflection.Classes.Attribute.getType(),
177-
"getAttribute", String.class)).invoke("max_health")).getBaseValue();
176+
return Objects.requireNonNull(
177+
ent.getAttribute((Attribute) Objects.requireNonNull(
178+
Reflection.getMethod(Reflection.Classes.Attribute.getType(),
179+
"getAttribute", String.class))
180+
.invoke(Reflection.Classes.Attribute, "max_health")))
181+
.getBaseValue();
178182
} catch (Exception e) {
179183
throw new RuntimeException(e);
180184
}

0 commit comments

Comments
 (0)