Add LivingEntity.realMaxHealth

because the normal one is deprecated :)
This commit is contained in:
mooziii
2022-04-12 11:52:22 +02:00
parent 4dcab23e3e
commit f224e00dba

View File

@@ -42,6 +42,14 @@ val Entity.isGroundSolid: Boolean get() = this.location.add(0.0, -0.01, 0.0).blo
*/
val Entity.groundMaterial get() = this.location.add(0.0, -0.01, 0.0).block.type
/**
* @return The max health of the entity
* @throws NullPointerException if the entity doesn't have a max health value
*/
val LivingEntity.realMaxHealth: Double
get() = getAttribute(Attribute.GENERIC_MAX_HEALTH)?.value
?: throw NullPointerException("The entity does not have a max health value!")
/**
* Kills the damageable.
*/