mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-25 02:27:41 +01:00
Check for attack damage attribute for mob attacks
This commit is contained in:
parent
5dc627ab49
commit
8ce9ec357c
@ -426,13 +426,12 @@ public class NMSImpl implements NMSBridge {
|
|||||||
PlayerAnimation.ARM_SWING.play((Player) source.getBukkitEntity());
|
PlayerAnimation.ARM_SWING.play((Player) source.getBukkitEntity());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (source instanceof Mob) {
|
boolean hasAttackDamage = source.getAttributes().hasAttribute(Attributes.ATTACK_DAMAGE);
|
||||||
|
if (source instanceof Mob && hasAttackDamage) {
|
||||||
((Mob) source).doHurtTarget(target);
|
((Mob) source).doHurtTarget(target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
float f = (float) (source.getAttributes().hasAttribute(Attributes.ATTACK_DAMAGE)
|
float f = (float) (hasAttackDamage ? source.getAttributeValue(Attributes.ATTACK_DAMAGE) : 1f);
|
||||||
? source.getAttributeValue(Attributes.ATTACK_DAMAGE)
|
|
||||||
: 1f);
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
f += EnchantmentHelper.getDamageBonus(source.getMainHandItem(), target.getMobType());
|
f += EnchantmentHelper.getDamageBonus(source.getMainHandItem(), target.getMobType());
|
||||||
i += EnchantmentHelper.getKnockbackBonus(source);
|
i += EnchantmentHelper.getKnockbackBonus(source);
|
||||||
|
Loading…
Reference in New Issue
Block a user