mirror of
https://github.com/Auxilor/EcoEnchants.git
synced 2024-11-26 15:45:12 +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) {
|
@NotNull final EntityDamageByEntityEvent event) {
|
||||||
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-level");
|
double multiplier = this.getConfig().getDouble(EcoEnchants.CONFIG_LOCATION + "health-per-level");
|
||||||
double amountToHeal = level * multiplier;
|
double amountToHeal = level * multiplier;
|
||||||
double newHealth = attacker.getHealth() + amountToHeal;
|
double newHealth = blocker.getHealth() + amountToHeal;
|
||||||
if (newHealth > attacker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
if (newHealth > blocker.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue()) {
|
||||||
newHealth = attacker.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