diff --git a/src/main/java/io/redspace/ironsspellbooks/entity/spells/magic_arrow/MagicArrowProjectile.java b/src/main/java/io/redspace/ironsspellbooks/entity/spells/magic_arrow/MagicArrowProjectile.java index 368bb47af..42f93f81d 100644 --- a/src/main/java/io/redspace/ironsspellbooks/entity/spells/magic_arrow/MagicArrowProjectile.java +++ b/src/main/java/io/redspace/ironsspellbooks/entity/spells/magic_arrow/MagicArrowProjectile.java @@ -73,14 +73,19 @@ protected void onHitEntity(EntityHitResult entityHitResult) { } } + BlockPos lastHitBlock; @Override protected void onHit(HitResult result) { //IronsSpellbooks.LOGGER.debug("onHit ({})", result.getType()); - penetration++; if (!level.isClientSide) { - if (result.getType() == HitResult.Type.ENTITY) { + var blockPos = new BlockPos(result.getLocation()); + if (result.getType() == HitResult.Type.BLOCK && !blockPos.equals(lastHitBlock)) { + penetration++; + lastHitBlock = blockPos; + } else if (result.getType() == HitResult.Type.ENTITY) { + penetration++; level.playSound(null, new BlockPos(position()), SoundRegistry.FORCE_IMPACT.get(), SoundSource.NEUTRAL, 2, .65f); //IronsSpellbooks.LOGGER.debug("Playing Sound"); }