Mojira Archive
MC-255439

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

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.

Unresolved

Dhranios

user-f2760

2022-08-22, 11:43 PM

2025-01-02, 12:08 PM

8

6

Confirmed

Sound

1.19.2 - 1.21.41.19.2, 1.19.3, 1.19.4, 1.20.1, 1.20.2, 23w43b, 1.20.4, 24w03b, 1.21.4

-