mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-22 15:05:18 +01:00
Fixed sycophant healing the attacker
This commit is contained in:
parent
f61745613b
commit
375ba8a7f0
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user