A custom enchantment using the minecraft:play_sound effect accepts an empty sound list during data pack loading. When the effect triggers on a ticking entity the game crashes.
Steps to reproduce:
Create a new world with the attached data pack enabled.
Run the following command to summon a husk holding a sword with the custom enchantment:
/summon minecraft:husk ~ ~ ~ {equipment:{mainhand:{id:"minecraft:diamond_sword",count:1,components:{"minecraft:enchantments":{"test:empty_sound":1}}}}}Wait one tick and observe the crash.
Observed result:
The game crashes.
Expected result:
An empty sound list in minecraft:play_sound should be rejected during data pack loading, or skipped at runtime.
Thank you for helping us improve Minecraft! We saved your files: