Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-275156

crossbow_charging_sounds enchantment duplicate sound effects

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.1, 24w34a, 24w37a
    • None
    • Community Consensus
    • Data Packs, Enchantments, Sound
    • Low
    • Platform

      When two entities reload crossbows at the same time that have custom enchantments containing the crossbow_charging_sounds effect, the sound plays more times than the number of entities reloading.

      What I expected to happen was...:
      The sound effects specified in the crossbow_charging_sounds should only play as many times as there are entities.

      What actually happened was...:
      The sound specified in the crossbow_charging_sounds 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 including the crossbow_charging_sounds effect. I have attached my test data pack containing the following enchantment:

      {
          "anvil_cost": 4,
          "description": "Test",
          "effects": {
            "minecraft:crossbow_charging_sounds": [
              {
                "start": "block.note_block.banjo"
              }
            ]
          },
          "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 give yourself pillager spawn eggs:

      /execute as @p run give @p pillager_spawn_egg[entity_data={id:"minecraft:pillager",HandItems:[{id:"minecraft:crossbow",count:1,components:{"minecraft:enchantments":{levels:{"tutorial:test":1}},"minecraft:enchantment_glint_override":false}},{}]}] 64 

      3. Have the pillagers target you and reload at the same time.

      4. Note that the reload sound, in this case, the banjo sound, plays many more times than there are pillagers reloading at a time.

            Unassigned Unassigned
            Icedice9 Matthew Cloward
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              CHK: