Skip to content

Commit

Permalink
Fix thorns and other attack effects being applied to shooter
Browse files Browse the repository at this point in the history
Fixes #90
  • Loading branch information
ThexXTURBOXx committed Feb 8, 2025
1 parent 0ca1bf4 commit e917772
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,13 +329,13 @@ public void applyEntityHitEffects(Entity entity) {
}
if (entity instanceof LivingEntity livingEntity) {
doKnockback(livingEntity, getDamageSource());
Entity shooter = getOwner();
if (shooter != null && level() instanceof ServerLevel serverLevel) {
EnchantmentHelper.doPostAttackEffectsWithItemSource(serverLevel, shooter,
if (level() instanceof ServerLevel serverLevel) {
EnchantmentHelper.doPostAttackEffectsWithItemSource(serverLevel, livingEntity,
getDamageSource(), getWeaponItem());
}
if (shooter instanceof ServerPlayer && !entity.equals(getOwner()) && entity instanceof Player) {
((ServerPlayer) shooter).connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.ARROW_HIT_PLAYER, 0.0f));
Entity shooter = getOwner();
if (shooter instanceof ServerPlayer sp && !entity.equals(getOwner()) && entity instanceof Player) {
sp.connection.send(new ClientboundGameEventPacket(ClientboundGameEventPacket.ARROW_HIT_PLAYER, 0.0f));
}
}
}
Expand Down

0 comments on commit e917772

Please sign in to comment.