Class HealthUtils

java.lang.Object
ch.njol.skript.bukkitutil.HealthUtils

public class HealthUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    damage(org.bukkit.entity.Damageable damageable, double damage)
    Apply damage to an entity
    static 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 entity
    static double
    getMaxHealth(org.bukkit.entity.Damageable damageable)
    Get the max health an entity has
    static void
    heal(org.bukkit.entity.Damageable damageable, double health)
    Heal an entity
    static 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 entity
    static void
    setMaxHealth(org.bukkit.entity.Damageable damageable, double health)
    Set the max health an entity can have

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 for
      health - 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 for
      health - 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 to
      damage - 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 heal
      health - 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)