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 damageable, double damage) Apply damage to an entitystatic void
damage
(org.bukkit.entity.Damageable damageable, double damage, org.bukkit.damage.DamageSource cause) static double
getDamage
(org.bukkit.event.entity.EntityDamageEvent event) static double
getFinalDamage
(org.bukkit.event.entity.EntityDamageEvent event) static double
getHealth
(org.bukkit.entity.Damageable damageable) Get the health of an entitystatic double
getMaxHealth
(org.bukkit.entity.Damageable damageable) Get the max health an entity hasstatic void
heal
(org.bukkit.entity.Damageable damageable, double health) Heal an entitystatic void
setDamage
(org.bukkit.event.entity.EntityDamageEvent event, double damage) static void
setDamageCause
(org.bukkit.entity.Damageable damageable, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause) static void
setHealth
(org.bukkit.entity.Damageable damageable, double health) Set the health of an entitystatic void
setMaxHealth
(org.bukkit.entity.Damageable damageable, 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 damageable) Get the health of an entity- Parameters:
damageable
- Entity to get health from- Returns:
- The amount of hearts the entity has left
-
setHealth
public static void setHealth(org.bukkit.entity.Damageable damageable, double health) Set the health of an entity- Parameters:
damageable
- Entity to set health forhealth
- The amount of hearts to set
-
getMaxHealth
public static double getMaxHealth(org.bukkit.entity.Damageable damageable) Get the max health an entity has- Parameters:
damageable
- 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 damageable, double health) Set the max health an entity can have- Parameters:
damageable
- Entity to set max health forhealth
- How many hearts the entity can have at most
-
damage
public static void damage(org.bukkit.entity.Damageable damageable, double damage) Apply damage to an entity- Parameters:
damageable
- Entity to apply damage todamage
- Amount of hearts to damage
-
damage
public static void damage(org.bukkit.entity.Damageable damageable, double damage, org.bukkit.damage.DamageSource cause) -
heal
public static void heal(org.bukkit.entity.Damageable damageable, double health) Heal an entity- Parameters:
damageable
- Entity to healhealth
- Amount of hearts to heal
-
getDamage
public static double getDamage(org.bukkit.event.entity.EntityDamageEvent event) -
getFinalDamage
public static double getFinalDamage(org.bukkit.event.entity.EntityDamageEvent event) -
setDamage
public static void setDamage(org.bukkit.event.entity.EntityDamageEvent event, double damage) -
setDamageCause
public static void setDamageCause(org.bukkit.entity.Damageable damageable, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
-