{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/minecraft-resourcepack-sounds/latest.json",
  "title": "Minecraft Sounds",
  "description": "A File defining what sounds play when sound event is triggered",
  "x-lintel": {
    "source": "https://raw.githubusercontent.com/AxoCode/json-schema/master/minecraft/sounds.json",
    "sourceSha256": "cfff8ca7057cc59256736f2804df6b2ec2fc62eff3d87cf4e3e8a735da00f2be",
    "fileMatch": [
      "**/assets/*/sounds.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "$schema": {
      "description": "Allow $schema because additionalProperties is false",
      "$ref": "#/$defs/string"
    }
  },
  "additionalProperties": {
    "description": "A sound event. The name is usually separated in categories (such as \"entity.enderman.stare\")",
    "type": "object",
    "properties": {
      "replace": {
        "description": "Used only in resource packs.\nTrue if the sounds listed in sounds should replace the sounds listed in the default sounds.json for this sound event\nFalse if the sounds listed should be added to the list of default sounds.\nDefault is false",
        "type": "boolean",
        "default": false
      },
      "subtitle": {
        "description": "Translated as the subtitle of the sound if Show Subtitles is enabled ingame.",
        "$ref": "#/$defs/string"
      },
      "sounds": {
        "description": "The sound files this sound event uses. One of the listed sounds is randomly selected to play when this sound event is triggered.",
        "type": "array",
        "if": {
          "items": {
            "type": "string"
          }
        },
        "then": {
          "items": {
            "$ref": "#/$defs/soundPath"
          }
        },
        "else": {
          "items": {
            "description": "A sound file. This Object is used only when the sound requires additional Strings.",
            "properties": {
              "name": {
                "$ref": "#/$defs/soundPath"
              },
              "volume": {
                "description": "The volume for playing this sound. Value is a decimal between 0.0 and 1.0\nDefault is 1.0",
                "type": "number",
                "default": 1.0,
                "minimum": 0.0,
                "maximum": 1.0
              },
              "pitch": {
                "description": "Plays the pitch at the specified value.\nDefault is 1.0",
                "type": "number",
                "default": 1.0
              },
              "weight": {
                "description": "The chance that this sound is selected to play when this sound event is triggered.\nExample: putting 2 in for the value would be like placing in the name twice.\nDefault is 1",
                "type": "integer",
                "default": 1
              },
              "stream": {
                "description": "True if this sound should be streamed from its file. It is recommended that this is set to \"true\" for sounds that have a duration longer than a few seconds to avoid lag. Used for all sounds in the \"music\" and \"record\" categories (except Note Block sounds), as (almost) all the sounds that belong to those categories are over a minute long. Setting this to false allows many more instances of the sound to be ran at the same time while setting it to true only allows 4 instances (of that type) to be ran at the same time.\nDefault is false",
                "type": "boolean",
                "default": false
              },
              "attenuation_distance": {
                "description": "Modify sound reduction rate based on distance. Used by portals, beacons, and conduits.\nDefault is 16",
                "type": "integer",
                "default": 16
              },
              "preload": {
                "description": "True if this sound should be loaded when loading the pack instead of when the sound is played. Used by the underwater ambience.\nDefault is false",
                "type": "boolean",
                "default": false
              },
              "type": {
                "description": "\"sound\" causes the value of \"name\" to be interpreted as the name of a file\n\"event\" causes the value of \"name\" to be interpreted as the name of an already defined event.\nDefault is \"sound\"",
                "type": "string",
                "default": "sound",
                "enum": [
                  "sound",
                  "event"
                ]
              }
            }
          }
        },
        "items": {
          "type": [
            "string",
            "object"
          ],
          "default": "",
          "additionalItems": false
        }
      }
    },
    "additionalProperties": false
  },
  "$defs": {
    "string": {
      "type": "string",
      "default": ""
    },
    "soundPath": {
      "$ref": "#/$defs/string",
      "description": "The path to a sound file from the \"namespace/sounds\" folder (excluding the .ogg file extension). Uses forward slashes.\nThe namespace defaults to minecraft but it can be changed by prepending a namespace and separating it with a :"
    }
  }
}
