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);
}
}

View File

@@ -0,0 +1,24 @@
#
# Dweller EcoEnchant
#
name: "Dweller"
description: Increases damage against illagers.
enabled: true
obtaining:
table: true
villager: true
loot: true
rarity: rare
general-config:
targets:
- sword
- axe
grindstoneable: true
conflicts: []
maximum-level: 3
config:
multiplier: 0.2 # 1 + (Level * Multiplier) is multiplied with the damage

View File

@@ -258,6 +258,7 @@ permissions:
ecoenchants.fromtable.ashartifact: true
ecoenchants.fromtable.tearartifact: true
ecoenchants.fromtable.backstab: true
ecoenchants.fromtable.dweller: true
ecoenchants.updateannounce:
description: Informs admins of a new update
@@ -895,4 +896,7 @@ permissions:
default: true
ecoenchants.fromtable.backstab:
description: Allows getting backstab from an enchanting table
default: true
ecoenchants.fromtable.dweller:
description: Allows getting dweller from an enchanting table
default: true