From 375ba8a7f01680805190de794e4cfc9b023b0268 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Thu, 22 Apr 2021 18:30:09 +0100 Subject: [PATCH] Fixed sycophant healing the attacker --- .../enchantments/ecoenchants/normal/Sycophant.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Sycophant.java b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Sycophant.java index af5fb9e3..96df8afd 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Sycophant.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/ecoenchants/enchantments/ecoenchants/normal/Sycophant.java @@ -23,10 +23,10 @@ public class Sycophant extends EcoEnchant { @NotNull final EntityDamageByEntityEvent event) { double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-level"); double amountToHeal = level * multiplier; - double newHealth = attacker.getHealth() + amountToHeal; - if (newHealth > attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) { - newHealth = attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); + double newHealth = blocker.getHealth() + amountToHeal; + if (newHealth > blocker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) { + newHealth = blocker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); } - attacker.setHealth(newHealth); + blocker.setHealth(newHealth); } }