Added configurable damage to forcefield

This commit is contained in:
Auxilor 2022-08-13 12:06:57 +02:00
parent f50c1d7c86
commit e76ddc6b89
2 changed files with 5 additions and 2 deletions

View File

@ -87,7 +87,9 @@ public class Forcefield extends EcoEnchant implements TimedRunnable {
((Monster) e).damage(damage);
if (NumberUtils.randFloat(0, 1) < 0.2) {
double damageChance = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "damage-chance");
if (NumberUtils.randFloat(0, 1) < damageChance) {
EnchantChecks.getArmorPoints(player, this, 1);
}
}

View File

@ -32,3 +32,4 @@ config:
bonus-per-level: 0.3 # Bonus range per level (Level 1 also includes bonus)
damage-per-level: 0.5
repeat-ticks: 20 # Damage nearby mobs every few ticks. Lower values lead to more damage and may cause lag
damage-chance: 0.2 # The chance for armor to be damaged every damage tick