Class DamageUtil

java.lang.Object
me.deecaad.weaponmechanics.weapon.damage.DamageUtil

public class DamageUtil extends Object
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    apply(me.deecaad.weaponmechanics.weapon.damage.WeaponDamageSource source, org.bukkit.entity.LivingEntity victim, double damage)
     
    static boolean
    canHarmScoreboardTeams(org.bukkit.entity.LivingEntity cause, org.bukkit.entity.LivingEntity victim)
     
    static void
    damageArmor(org.bukkit.entity.LivingEntity victim, me.deecaad.weaponmechanics.weapon.damage.WeaponDamageSource source, int amount)
     
    static boolean
    tryUseTotemOfUndying(org.bukkit.entity.LivingEntity entity)
    Attempts to use a totem of undying on the entity.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • apply

      public static boolean apply(@NotNull me.deecaad.weaponmechanics.weapon.damage.WeaponDamageSource source, @NotNull org.bukkit.entity.LivingEntity victim, double damage)
      Parameters:
      source - What caused the damage.
      victim - The victim being damaged.
      damage - The amount of damage to apply
      Returns:
      true if damage was cancelled
    • damageArmor

      public static void damageArmor(@NotNull org.bukkit.entity.LivingEntity victim, @NotNull me.deecaad.weaponmechanics.weapon.damage.WeaponDamageSource source, int amount)
    • canHarmScoreboardTeams

      public static boolean canHarmScoreboardTeams(@NotNull org.bukkit.entity.LivingEntity cause, @NotNull org.bukkit.entity.LivingEntity victim)
      Parameters:
      cause - the cause entity (shooter of projectile)
      victim - the victim
      Returns:
      true only if cause can harm victim
    • tryUseTotemOfUndying

      public static boolean tryUseTotemOfUndying(@NotNull org.bukkit.entity.LivingEntity entity)
      Attempts to use a totem of undying on the entity. This will return false if the entity does not have a totem of undying, or if the EntityResurrectEvent is cancelled. This method will return true if the totem affect is used.
      Parameters:
      entity - The non-null entity to use the totem on.
      Returns:
      true if the totem was used.