When two entities reload crossbows at the same time with a custom enchantment, the sound plays more times than the number of entities reloading. This bug occurs regardless of whether or not the crossbow_charging_sounds effect is used.
What I expected to happen was...:
The crossbow reloading sounds should only play as many times as there are entities reloading.
What actually happened was...:
The reload sound plays a bunch of times during the overlap that the two entities are charging their crossbows.
Steps to Reproduce:
1. Create a data pack containing a custom enchantment. I have attached my test data pack containing the following enchantment. As you can see, it should not do anything.
{
"anvil_cost": 4,
"description": "test",
"max_cost": {
"base": 65,
"per_level_above_first": 9
},
"max_level": 1,
"min_cost": {
"base": 15,
"per_level_above_first": 9
},
"slots": [
"mainhand",
"offhand"
],
"supported_items": "#minecraft:enchantable/crossbow",
"weight": 2
}
2. Load the data pack in any 1.21+ world.
2. Spawn two pillagers with crossbows that have the enchantment. Here is a command to summon them:
/summon pillager ~ ~ ~ {equipment:{mainhand:{id:"minecraft:crossbow",count:1,components:{"minecraft:enchantments":{"minecraft:test":1}}}}}
3. Have the pillagers target you and reload at the same time.
4. Note that the reload sound plays many more times than the number of pillagers reloading.
5. Because the vanilla crossbow reload sound is quiet, you can hear it better using a resource pack that changes the crossbow reloading start sound to a noteblock banjo sound, using this sounds.json:
{
"item.crossbow.loading_start": {
"replace": true,
"sounds": [
{
"name": "note/banjo"
}
], "subtitle": "subtitles.item.crossbow.charge"
}
}
Can confirm:
[media]