Mojira Archive
MCPE-154376

min_distance / max_distance leaks across sound definitions that use the same sound file

The bug

Sound definitions have optional min_distance and max_distance fields, which are usually not included. However, when you include one in a sound event, once that event plays, it applies to all sound events that use the same sound file! In other words, as the title says, these fields "leak" across to other events that do not specify them.

How to reproduce

1. Download and open the attached world
2. Activate the command blocks from left to right
They should sound in this order: quiet, loud, quiet, loud
3. Now activate the first one again
It's now loud! It's permanently loud as a result of the second command block

Sound file

For reference, here is the sound_definitions.json file used.
Once max50_shared is played, max3_shared suddenly starts playing as if it had max_distance set to 50, even though it doesn't!
max50_unique doesn't affect max3_unique, because they use separate sound files.

{
   "format_version": "1.14.0",
   "sound_definitions": {
      "max3_shared": {
         "category": "neutral",
         "sounds": [
            {
               "name": "sounds/shared"
            }
         ]
      },
      "max50_shared": {
         "category": "neutral",
         "max_distance": 50.0,
         "sounds": [
            {
               "name": "sounds/shared"
            }
         ]
      },
      "max3_unique": {
         "category": "neutral",
         "sounds": [
            {
               "name": "sounds/unique1"
            }
         ]
      },
      "max50_unique": {
         "category": "neutral",
         "max_distance": 50.0,
         "sounds": [
            {
               "name": "sounds/unique2"
            }
         ]
      }
   }
}

Fixed

[Mod] tryashtar

2022-04-22, 04:57 AM

2022-11-29, 07:52 PM

2022-11-29, 07:52 PM

2

1

Confirmed

866855

1.18.30

1.19.50.20 Preview, 1.19.50