mojira.dev
MC-257516

"Fox teleports" sound plays for both Players and Friendly Creatures sound categories

The Bug

When a fox teleports using a chorus fruit, the sound will play if the Players or the Friendly Creatures sound category is on.

To Reproduce

  1. Turn off all sound categories except for Players.

  2. Spawn a fox and make it eat chorus fruit, or use the command /summon fox ~ ~ ~ {HandItems:[{Count:1b,id:"chorus_fruit"}]}

  3.  Wait until the fox teleports, and observe the fox making the sound

  4. Repeat, but with the Friendly Creatures sound category being the only one turned on.

Solution

ChorusFruitItem calls both level.playSound and livingEntity.playSound. level.playSound calls it exclusively using SoundSource.PLAYERS. Remove this line, or do something else with it.

Comments 1

 This bug was fixed in 23w44a.

NOoooo3333

(Unassigned)

Confirmed

Gameplay

Low

Sound

chorus_fruit, fox

1.19.2, 22w45a, 1.19.3

23w44a

Retrieved