use of org.bukkit.entity.ElderGuardian in project EcoEnchants by Auxilor.
the class BossHunter method onArrowDamage.
@Override
public void onArrowDamage(@NotNull final LivingEntity attacker, @NotNull final LivingEntity victim, @NotNull final Arrow arrow, final int level, @NotNull final EntityDamageByEntityEvent event) {
if (!(victim instanceof Boss || victim instanceof ElderGuardian) && !victim.getPersistentDataContainer().has(new NamespacedKey("ecobosses", "boss"), PersistentDataType.STRING)) {
return;
}
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
double damageMultiplier = (level * multiplier) + 1;
event.setDamage(event.getDamage() * damageMultiplier);
}
Aggregations