Package ch.njol.skript.bukkitutil
Class HealthUtils
java.lang.Object
ch.njol.skript.bukkitutil.HealthUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voiddamage(org.bukkit.entity.Damageable e, double d)Apply damage to an entitystatic doublegetDamage(org.bukkit.event.entity.EntityDamageEvent e)static doublegetFinalDamage(org.bukkit.event.entity.EntityDamageEvent e)static doublegetHealth(org.bukkit.entity.Damageable e)Get the health of an entitystatic doublegetMaxHealth(org.bukkit.entity.Damageable e)Get the max health an entity hasstatic voidheal(org.bukkit.entity.Damageable e, double h)Heal an entitystatic voidsetDamage(org.bukkit.event.entity.EntityDamageEvent e, double damage)static voidsetDamageCause(org.bukkit.entity.Damageable e, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)static voidsetHealth(org.bukkit.entity.Damageable e, double health)Set the health of an entitystatic voidsetMaxHealth(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 e, double damage) -
setDamageCause
public static void setDamageCause(org.bukkit.entity.Damageable e, org.bukkit.event.entity.EntityDamageEvent.DamageCause cause)
-