diff --git a/common/src/main/java/dev/dubhe/anvilcraft/item/AnvilHammerItem.java b/common/src/main/java/dev/dubhe/anvilcraft/item/AnvilHammerItem.java index b12212bce..d6b6af927 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/item/AnvilHammerItem.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/item/AnvilHammerItem.java @@ -145,6 +145,14 @@ public boolean hurtEnemy(@NotNull ItemStack stack, @NotNull LivingEntity target, stack.hurtAndBreak(1, attacker, e -> e.broadcastBreakEvent(EquipmentSlot.MAINHAND)); float damageBonus = attacker.fallDistance > 17 ? 34 : attacker.fallDistance * 2; target.hurt(target.level().damageSources().anvil(attacker), damageBonus); + if (attacker.fallDistance >= 3) { + attacker.level().playSound(null, + BlockPos.containing(attacker.position()), + SoundEvents.ANVIL_LAND, SoundSource.BLOCKS, + 1f, + attacker.fallDistance > 17 ? (float) 0.5 : 1 - attacker.fallDistance / 35 + ); + } return true; } diff --git a/common/src/main/java/dev/dubhe/anvilcraft/item/GeodeItem.java b/common/src/main/java/dev/dubhe/anvilcraft/item/GeodeItem.java index 8fb017d2b..574e6ff47 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/item/GeodeItem.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/item/GeodeItem.java @@ -9,6 +9,7 @@ import net.minecraft.network.chat.ComponentUtils; import net.minecraft.network.chat.HoverEvent; import net.minecraft.network.chat.MutableComponent; +import net.minecraft.sounds.SoundEvents; import net.minecraft.tags.BlockTags; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResultHolder; @@ -74,6 +75,7 @@ public GeodeItem(Properties properties) { } } } + player.playSound(SoundEvents.AMETHYST_BLOCK_RESONATE); return InteractionResultHolder.success(itemStack); } }