fixed bash effect not being applied clientside
@@ -324,10 +324,10 @@ public class ItemModularHandheld extends ItemModular {
}
public void bashEntity(ItemStack itemStack, int bashingLevel, PlayerEntity player, LivingEntity target) {
-
+ // apply damage
double damage = getAbilityBaseDamage(itemStack) + EnchantmentHelper.getModifierForCreature(itemStack, target.getCreatureAttribute());
+ target.attackEntityFrom(DamageSource.causePlayerDamage(player), (float) damage);
- if (target.attackEntityFrom(DamageSource.causePlayerDamage(player), (float) damage)) {
// applies enchantment effects on both parties
EnchantmentHelper.applyThornEnchantments(target, player);
ItemModularHandheld.applyEnchantmentHitEffects(itemStack, target, player);
@@ -347,7 +347,6 @@ public class ItemModularHandheld extends ItemModular {
if (stunDuration > 0) {
target.addPotionEffect(new EffectInstance(StunEffect.instance, (int) Math.round(stunDuration * 20), 0, false, false));
}
- }
player.getEntityWorld().playSound(player, target.getPosition(), SoundEvents.ENTITY_PLAYER_ATTACK_KNOCKBACK, SoundCategory.PLAYERS, 1, 0.7f);
