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 e, double d)
    Apply damage to an entity
    static 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 entity
    static double
    getMaxHealth​(org.bukkit.entity.Damageable e)
    Get the max health an entity has
    static void
    heal​(org.bukkit.entity.Damageable e, double h)
    Heal an entity
    static void
    setDamage​(org.bukkit.event.entity.EntityDamageEvent e, 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 entity
    static void
    setMaxHealth​(org.bukkit.entity.Damageable e, 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 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 for
      health - 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 for
      health - 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 to
      d - Amount of hearts to damage
    • heal

      public static void heal(org.bukkit.entity.Damageable e, double h)
      Heal an entity
      Parameters:
      e - Entity to heal
      h - 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)