Added Dweller
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user