When using the component "minecraft:ambient_sound_interval": {} and setting the event_name to a custom sound event defined in the mobs entity sounds (in the sounds.json file). The sound will never play.
Steps To Reproduce:
Download, install and start a world with the supplied pack
Summon a cow
Observe that no sheep sounds are played
There is a sound event 'custom_event' in the resource packs sounds.json file that uses a sheep sound
There is also an ambient_sound_interval component trying to run this sound constantly but it never plays
Go into the cows behaviour file and with the comments around the ambient sound intervals so that the hurt sound event is no longer commented
The cow will now begin to make hurt sounds
Expected Results:
Custom sound events can be used by the ambient_sound_interval component (as well as all other sound event using components)
Actual Behaviour:
Custom sound events don't work for the ambient_sound_interval component
Attachments
Comments 7
It seems like you are trying to use two "hurt" sound components, which can be confusing for the game, resulting in not playing any sound at all. Do you agree?
Perhaps my explanation was confusing:
In the sounds file in the resource pack I've added a sound event 'custom_event', the sound linked to this event is the sheeps hurt sound (could be any sound).
In the cows behaviour file there are two ambient_sound_interval components in the components, one commented out and one not:
When the pack is loaded without changing anything, the cow is using ambient_sound_interval with no delay to play the 'custom_event' sound event, a sound event not used by vanilla packs. This sound event will never play.
Commenting out the custom_event line and uncommenting the second line, the cow is now using ambient_sound_interval with no delay to play the 'hurt' event, this sound event is used in vanilla packs and thus is recognised by ambient_sound_interval and will play sounds.
The bug is that ambient_sound_interval will only recognise vanilla sound_events: (ambient, death, hurt, step, sleep, etc.) and will fail to recognise any custom sound events, in this packs case, custom_event.
Is this still an issue in the latest version? If yes, can you please add it to the affected versions (or mention it if you are not the reporter)?
This ticket will automatically reopen when you reply.
Thanks for the additional information. We believe this is working as intended for now, within the current limitations of the system. Our development team have suggested a potential workaround:
You can choose from the standard ambient events like "ambient", "ambient.in.water", "ambient.in.raid" etc, and then do a custom mapping between these events and the actual sounds in sounds.json, under "entity_sounds".
Does this enable you to accomplish what you're trying to achieve? If not, do you believe there is a bug at play?
This is still happening. I cannot get custom sound definitions to play using ambient_sound_interval. Any vanilla sound def I try works with no issue.
EDIT: After reading the comments I decided to remove the event_name from the component to see if it would use the sounds.json instead. That worked. Strange thing is that the event wouldn't work when there was no sounds.json present and only the sound_def.json. I'm not sure if this is a bug or how it is supposed to be.
Resolving temporarily as Awaiting Response. Could you please attach the add-ons you're using to this ticket?