mojira.dev
MC-190370

Sound event "entity.mooshroom.shear" is cut off when triggered in game

The Bug:

I was continuing progress with my resource pack when i wanted to add a unique sound when shearing mooshrooms. I made the sound and added it to the sounds.json file. I used "/playsound" and the sound works correctly. Only when I actually shear a mooshroom is when the sound abruptly cuts off a few seconds after it plays. I even set the tag "stream:" to "true" and it still doesn't work as intended.

To Reproduce:

  1. Replace the sheep shearing sound (or your custom mooshroom sound) with another sound that is atleast longer than 3 seconds.

  2. Use the "/playsound" command and it should play the whole sound without stopping.

  3. Summon or spawn a mooshroom and shear it.
    → ❌ The sound plays for a bit, but then gets cut off a few ticks later.

Why this is a problem:

This could be a problem with resource pack creators because they might've put a longer custom sound but it doesn't play fully. It feels like their input of customisation is lost for this specific sound.

Example Resource Pack:

I have provided an example resource pack to show the issue. Make sure you type /playsound first before testing it with the mooshrooms.

Linked issues

Attachments

Comments 8

Could you please provide an example resource pack with the sound changed?

Also is this the only sound affected by this? Or are other sounds affected too?

as far as i'm aware, it's this sound only. shearing a sheep plays it normally

Also I just tested it, it DOESN'T occur in 1.15.2 for some reason

I have provided an example resourcepack. It is now in attachments

Possibly caused by the entity that's the source of the sound (the mooshroom itself) being deleted (and replaced with a cow)?

Normally that doesn't matter; if you wait for a mob to make a sound, and teleport it far away, the sound still plays; additionally, the mooshroom is gone the moment the cow is there, not 3 seconds later. This also doesn't seem to happen with converting zombies and their variants, or skeletons from what I can tell.

Looked at the code a bit more.
EntityBoundSoundInstance#tick explicitly stops the sound if this.entity.isRemoved.
Therefore teleports have no effect.
Converting zombies/skeletons use a level event which does not keep track of the entity that sent it.

DreamedWave4364

(Unassigned)

Confirmed

Sound

1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w28a, ..., 1.16.5, 1.17.1, 1.18 Pre-release 1, 1.18 Pre-release 4, 1.19.2

Retrieved