mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2024-12-23 17:47:35 +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());
|
||||
return;
|
||||
}
|
||||
if (source instanceof Mob) {
|
||||
boolean hasAttackDamage = source.getAttributes().hasAttribute(Attributes.ATTACK_DAMAGE);
|
||||
if (source instanceof Mob && hasAttackDamage) {
|
||||
((Mob) source).doHurtTarget(target);
|
||||
return;
|
||||
}
|
||||
float f = (float) (source.getAttributes().hasAttribute(Attributes.ATTACK_DAMAGE)
|
||||
? source.getAttributeValue(Attributes.ATTACK_DAMAGE)
|
||||
: 1f);
|
||||
float f = (float) (hasAttackDamage ? source.getAttributeValue(Attributes.ATTACK_DAMAGE) : 1f);
|
||||
int i = 0;
|
||||
f += EnchantmentHelper.getDamageBonus(source.getMainHandItem(), target.getMobType());
|
||||
i += EnchantmentHelper.getKnockbackBonus(source);
|
||||
|
Loading…
Reference in New Issue
Block a user