Class DamageUtil
java.lang.Object
me.deecaad.weaponmechanics.weapon.damage.DamageUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanapply(me.deecaad.weaponmechanics.weapon.damage.WeaponDamageSource source, org.bukkit.entity.LivingEntity victim, double damage) static booleancanHarmScoreboardTeams(org.bukkit.entity.LivingEntity cause, org.bukkit.entity.LivingEntity victim) static voiddamageArmor(org.bukkit.entity.LivingEntity victim, me.deecaad.weaponmechanics.weapon.damage.WeaponDamageSource source, int amount) static booleantryUseTotemOfUndying(org.bukkit.entity.LivingEntity entity) Attempts to use a totem of undying on the entity.
-
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 theEntityResurrectEventis 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.
-