Class HealthUtils

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

public class HealthUtils extends Object
  • Constructor Details

    • HealthUtils

      public HealthUtils()
  • Method Details

    • getHealth

      public static double getHealth(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(Damageable e, double health)
      Set the health of an entity
      Parameters:
      e - Entity to set health for
      health - The amount of hearts to set
    • getMaxHealth

      public static double getMaxHealth(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(Damageable e, double health)
      Set the max health an entity can have
      Parameters:
      e - Entity to set max health for
      health - How many hearts the entity can have at most
    • resetMaxHealth

      public static void resetMaxHealth(Damageable entity)
      Reset max health of an entity
      Parameters:
      entity - Entity to reset max health
    • damage

      public static void damage(Damageable e, double d)
      Apply damage to an entity
      Parameters:
      e - Entity to apply damage to
      d - Amount of hearts to damage
    • heal

      public static void heal(Damageable e, double h)
      Heal an entity
      Parameters:
      e - Entity to heal
      h - Amount of hearts to heal
    • getDamage

      public static double getDamage(EntityDamageEvent e)
    • getFinalDamage

      public static double getFinalDamage(EntityDamageEvent e)
    • setDamage

      public static void setDamage(EntityDamageEvent event, double damage)
    • setDamageCause

      public static void setDamageCause(Damageable e, EntityDamageEvent.DamageCause cause)