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(org.bukkit.entity.LivingEntity cause, 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, int amount)
     
    static void
    damageArmor(org.bukkit.entity.LivingEntity victim, int amount, @Nullable DamagePoint point)
     
    static boolean
    isWhitelisted(org.bukkit.entity.EntityType type)
    Mobs without spawn eggs didn't have statistics associated with them before 1.13.

    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(org.bukkit.entity.LivingEntity cause, org.bukkit.entity.LivingEntity victim, double damage)
      Parameters:
      cause - The shooter that caused the damage.
      victim - The victim being damaged.
      damage - The amount of damage to apply
      Returns:
      true if damage was cancelled
    • isWhitelisted

      public static boolean isWhitelisted(org.bukkit.entity.EntityType type)
      Mobs without spawn eggs didn't have statistics associated with them before 1.13. See https://bugs.mojang.com/browse/MC-33710.
      Parameters:
      type - The entity type.
      Returns:
      false if there is no statistic.
    • damageArmor

      public static void damageArmor(org.bukkit.entity.LivingEntity victim, int amount)
    • damageArmor

      public static void damageArmor(org.bukkit.entity.LivingEntity victim, int amount, @Nullable @Nullable DamagePoint point)
    • canHarmScoreboardTeams

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