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

No content log warnings for invalid data in sound_definitions.json

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.80.22 Preview, 1.20.0, 1.20.40.22 Preview
    • None
    • Confirmed
    • Windows
    • 1007130

      The bug

      Most pack files produce content log warnings when a file does not match the schema, so creators know how to fix their files. However, errors in the sound_definitions.json file are silently ignored.

      How to reproduce

      1. With content logs enabled, download and open the attached world

      Expected result
      Content log errors for:
      invalid not valid in root of file
      sound1 value must be of type object, not string Fixed
      invalid not valid in sound2
      category must be of type string, not boolean
      max_distance must be of type number, not string
      min_distance must be of type number, not string
      sounds must be of type list, not string
      invalid is not a valid sound category
      sounds entries must be of type string or object, not boolean
      name must be included in sound entries object
      invalid not valid in sound entry
      is3D must be of type boolean, not string
      pitch must be of type number, not string
      stream must be of type boolean, not string
      weight must be of type number, not string
      volume must be of type number, not string
      missing_sound sound was not found

      Observed result
      No errors are printed, the invalid data is silently loaded.

      Notes
      For reference, here is the relevant file contents:

      {
         "format_version": "1.19.40",
         "invalid": true,
         "sound_definitions": {
            "sound1": "invalid",
            "sound2": {
               "invalid": "invalid",
               "category": true,
               "max_distance": "invalid",
               "min_distance": "invalid",
               "sounds": "invalid"
            },
            "sound3": {
               "category": "invalid",
               "sounds": [
                  true
               ]
            },
            "sound4": {
               "sounds": [
                  {
                     "invalid": "invalid",
                     "is3D": "invalid",
                     "pitch": "invalid",
                     "stream": "invalid",
                     "weight": "invalid",
                     "volume": "invalid"
                  }
               ]
            },
            "sound5": {
               "sounds": [
                  "missing_sound",
                  {
                     "name": "missing_sound"
                  }
               ]
            }
         }
      }
      

      It's also worth noting that vanilla's definitions file contains these kinds of errors.

            tryashtar [Mod] tryashtar
            Votes:
            3 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              CHK: