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