Added Dweller

This commit is contained in:
Auxilor
2020-11-04 19:52:50 +00:00
parent 45f666547f
commit df5b957a6b
4 changed files with 57 additions and 0 deletions

View File

@@ -235,6 +235,7 @@ public class EcoEnchants {
public static final EcoEnchant WARPED_ARTIFACT = new WarpedArtifact();
public static final EcoEnchant TEAR_ARTIFACT = new TearArtifact();
public static final EcoEnchant BACKSTAB = new Backstab();
public static final EcoEnchant DWELLER = new Dweller();
/**
* Get all registered {@link EcoEnchant}s

View File

@@ -0,0 +1,28 @@
package com.willfp.ecoenchants.enchantments.ecoenchants.normal;
import com.willfp.ecoenchants.enchantments.EcoEnchant;
import com.willfp.ecoenchants.enchantments.EcoEnchants;
import org.bukkit.entity.Illager;
import org.bukkit.entity.LivingEntity;
import org.bukkit.event.entity.EntityDamageByEntityEvent;
public final class Dweller extends EcoEnchant {
public Dweller() {
super(
"dweller", EnchantmentType.NORMAL
);
}
// START OF LISTENERS
@Override
public void onMeleeAttack(LivingEntity attacker, LivingEntity victim, int level, EntityDamageByEntityEvent event) {
if(!(victim instanceof Illager))
return;
double damage = event.getDamage();
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "multiplier");
double bonus = 1 + (multiplier * level);
event.setDamage(damage * bonus);
}
}