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

Sounds.json's attenuation distance doesn't work with type: event

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.2, 1.19.3, 1.19.4, 1.20.1, 1.20.2, 23w43b, 1.20.4, 24w03b
    • None
    • Confirmed
    • Sound

      Attenuation distance controls how far away a sound can be heard before it's silent. This works properly with type "sound" (default) entries, but not with type "event" entries; it'll use the parent's attenuation distance, rather than using the event's, or multiplying with it (divided by 16).

      Steps to reproduce:

      1. Create a sounds.json with the following:
        {
            "custom.parent": {
                "sounds": [
                    {
                        "name": "mob/zombie/hurt2"
                    }
                ]
            },
            "custom.event": {
                "sounds": [
                    {
                        "type": "event",
                        "name": "custom.parent",
                        "attenuation_distance": 2
                    }
                ]
            },
            "custom.sound": {
                "sounds": [
                    {
                        "name": "mob/zombie/hurt2",
                        "attenuation_distance": 2
                    }
                ]
            }
        }
      2. Logic dictates that custom.sound and custom.event both have an attenuation distance of 2 blocks.
      3. Use /playsound custom.sound master @s ~ ~ ~ and /playsound custom.sound master @s ~ ~ ~3
      4. Observe how the first command's sound can be heard, but the second one can't
      5. Use /playsound custom.event master @s ~ ~ ~ and /playsound custom.event master @s ~ ~ ~3
      6. Observe how the both command's sound can be heard.

      Expected result:
      custom.event has an attenuation distance of 2 blocks.

      Actual result:
      custom.event has an attenuation distance of the default value of 16 blocks because that's what custom.parent's attenuation distance is.

            Unassigned Unassigned
            jirauser71590 user-f2760 (Inactive)
            Votes:
            7 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              CHK: