Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-154376

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

XMLWordPrintable

    • Confirmed
    • Windows
    • 866855

      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"
                  }
               ]
            }
         }
      }
      

            tryashtar [Mod] tryashtar
            Votes:
            2 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: