Package ch.njol.skript.bukkitutil
Class HealthUtils
java.lang.Object
ch.njol.skript.bukkitutil.HealthUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
damage
(Damageable e, double d) Apply damage to an entitystatic double
static double
static double
Get the health of an entitystatic double
Get the max health an entity hasstatic void
heal
(Damageable e, double h) Heal an entitystatic void
resetMaxHealth
(Damageable entity) Reset max health of an entitystatic void
setDamage
(EntityDamageEvent event, double damage) static void
static void
setHealth
(Damageable e, double health) Set the health of an entitystatic void
setMaxHealth
(Damageable e, double health) Set the max health an entity can have
-
Constructor Details
-
HealthUtils
public HealthUtils()
-
-
Method Details
-
getHealth
Get the health of an entity- Parameters:
e
- Entity to get health from- Returns:
- The amount of hearts the entity has left
-
setHealth
Set the health of an entity- Parameters:
e
- Entity to set health forhealth
- The amount of hearts to set
-
getMaxHealth
Get the max health an entity has- Parameters:
e
- Entity to get max health from- Returns:
- How many hearts the entity can have at most
-
setMaxHealth
Set the max health an entity can have- Parameters:
e
- Entity to set max health forhealth
- How many hearts the entity can have at most
-
resetMaxHealth
Reset max health of an entity- Parameters:
entity
- Entity to reset max health
-
damage
Apply damage to an entity- Parameters:
e
- Entity to apply damage tod
- Amount of hearts to damage
-
heal
Heal an entity- Parameters:
e
- Entity to healh
- Amount of hearts to heal
-
getDamage
-
getFinalDamage
-
setDamage
-
setDamageCause
-