Search in sources :

Example 1 with ElderGuardian

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);
}
Also used : Boss(org.bukkit.entity.Boss) NamespacedKey(org.bukkit.NamespacedKey) ElderGuardian(org.bukkit.entity.ElderGuardian)

Aggregations

NamespacedKey (org.bukkit.NamespacedKey)1 Boss (org.bukkit.entity.Boss)1 ElderGuardian (org.bukkit.entity.ElderGuardian)1