mojira.dev
MC-305285

Enchantments (and possibly other stuff) fail to validate datapacks when using the "playsound" field in enchantments for custom sound events using string, however, the datack validates when using object instead

Works: {
              "type": "minecraft:play_sound",
              "sound": {
                "sound_id": "ns:example.sound"
              },
              "volume": 1,
              "pitch": 1
            }

Doesn't work: {
              "type": "minecraft:play_sound",
              "sound": "ns:example.sound",
              "volume": 1,
              "pitch": 1
            }

Vanilla Sound Event

Custom Sound Event

Object Reference

Works

Works

String Reference

Works

Doesn’t Work

Check the comments for the zip containing these 3 folders:
1. The Resource Pack containing the sound.
2. The WORKING Datapack containing the enchantments: Vanilla String, Vanilla Object, and Custom Object.
3. The Datapack that throws an error containing the enchantment: Custom String

Attachments

Comments 1

[media]

This is the zip containing all three folders mentionated above. All enchantments use a location_changed field, meaning you have to walk while holding the enchanted item to hear the sound
Please avoid enchanting the same item with all enchantments, because this may lead to many sounds playing, being hard to identify them

Void

(Unassigned)

Unconfirmed

(Unassigned)

1.21.11, 26.1 Snapshot 1

Retrieved