Data packs with custom jukebox songs will fail to load if the "sound_event" field is set to a sound event not defined by the vanilla resource pack, causing the game to ask if you want to load the world in safe mode. This will always happen even if there is a resource pack loaded that does define the missing sound event.
For example, the following file is valid:
{
"comparator_output": 0,
"description": {
"text": "Test"
},
"length_in_seconds": 10.0,
"sound_event": "ui.toast.challenge_complete"
}
But the next one isn't:
{
"comparator_output": 0,
"description": {
"text": "Test"
},
"length_in_seconds": 10.0,
"sound_event": "bug:test"
}
A sample data pack and resource pack is provided.
To reproduce:
Download jukebox_resource.zip and place it in the resourcepacks folder. Add the resource pack to the active packs list.
Download jukebox_datapack.zip and place it in the world folder.
Attempt to load the world the datapack was added to.
What will happen:
The world will be prevented from loading by an error in the data pack
What was expected to happen:
The world would load and you would be able to give yourself an item with the jukebox_playable component with the song set to "bug:test".
Additional info:
From the game log:
[22:19:42] [Render thread/INFO]: Found new data pack file/jukebox_datapack.zip, loading it automatically
[22:19:43] [Render thread/ERROR]: Registry loading errors:
> Errors in registry minecraft:jukebox_song:
>> Errors in element bug:test:
java.lang.IllegalStateException: Failed to parse bug:jukebox_song/test.json from pack file/jukebox_datapack.zip
Caused by: java.lang.IllegalStateException: Failed to get element ResourceKey[minecraft:sound_event / bug:test]
Linked issues
is duplicated by 3
relates to 2
Attachments
Comments 11
Was working on a resource pack to add custom music discs literally last night. When I saw the snapshot changes, I was excited and have been working on a data pack for a couple hours based on that. Bummer we can't specify non-vanilla sound events, hopefully that's a feature that will get added soon.
I thought I was going mad, I was making datapack/resource pack, and I was only getting errors while everything was in order.
I hope this is just an oversight, because it is a really cool feature.
@unknown already pointed this out, but to apply the Gist to this specific case, use this definition instead:
{
"comparator_output": 0,
"description": {
"text": "Test"
},
"length_in_seconds": 10.0,
"sound_event": {
"sound_id": "bug:test"
}
}
Thank you for your report!
After consideration, the issue is being closed as Invalid.
This report does not describe a bug.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Well this is rendered useless (for the moment, I hope so) because you can't get set sounds added in a custom resource pack unless it is a mod (AFAIK).
We can only play sound already in the game
Can confirm:
[media]