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

min_distance / max_distance requires decimal numbers, silently fails with integers

XMLWordPrintable

    • Confirmed
    • Windows
    • 866829

      The bug

      If you specify a min_distance field in a sound definition without including a decimal point, the field is completely ignored with no error or warning. Other fields like pitch work just fine.

      How to reproduce

      1. Download and open the attached world
      2. Use the two command blocks
      Expected result: They should sound identical
      Actual result: The one on the left is quieter because its max_distance field was ignored

      Sound file

      For reference, here is the sound_definitions.json file. integer completely ignores the max_distance because it's set to 50 instead of 50.0.

      {
         "format_version": "1.14.0",
         "sound_definitions": {
            "integer": {
               "category": "neutral",
               "max_distance": 50,
               "sounds": [
                  {
                     "name": "sounds/unique1"
                  }
               ]
            },
            "float": {
               "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: