mojira.dev
MC-270554

Player attack sounds emanate from the player's position rather than the position of the attacked entity

This issue is related to MC-268946. Clones MC-269321.
When attacking an entity, sounds such as

minecraft:entity.player.attack.strong

,

minecraft:entity.player.attack.crit

,

minecraft:entity.player.attack.knockback

,

minecraft:entity.player.attack.sweep

,

minecraft:item.mace.smash_air

,

minecraft:item.mace.smash_ground

,

minecraft:item.mace.smash_ground_heavy

are played at the player's position instead of the entity's position. While this could be intentional, it's inconsistent with entity interactions triggered by right-clicking, where sounds are played at the entity's position as expected. For instance, shearing a sheep produces the shearing sound at the sheep's position. It's unclear when sounds like

minecraft:entity.player.attack.weak

and

minecraft:entity.player.attack.nodamage

play. This discrepancy might be intentional to prevent excessively loud sounds for the attacking player upon hitting another player.

Steps to reproduce

  1. /attribute @s minecraft:player.entity_interaction_range base set 64
  2. /summon minecraft:warden ~ ~ ~ {NoAI:1b,Silent:1b}
  3. Be far away from it (about 50 blocks)

  4. Attack the warden

  5. Attack the warden with a critical hit

  6. Attack the warden with a sweeping attack

  7. Attach the warden while sprinting to do a knockback attack

  8. Attack the warden while falling by using a mace

  9. Come closer to the warden

  10. Repeat steps 4-8

Observed: All attack sounds were heard at your position, as evidenced by their consistent volume regardless of proximity to the warden.

Expected: All attack sounds should originate from the warden's position, meaning they should either be inaudible from a distance or barely audible.

Linked issues

Attachments

Comments 0

No comments.

The minecrafter

No User

(Unassigned)

Confirmed

Sound

1.20.4, 24w14a, 1.20.5 Pre-Release 1

Retrieved