{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/minecraft-data-pack-metadata/latest.json",
  "description": "Minecraft Resource/Data Pack Metadata\n<https://minecraft.wiki/w/Pack.mcmeta#Format>",
  "x-lintel": {
    "source": "https://www.schemastore.org/minecraft-pack-mcmeta.json",
    "sourceSha256": "c238764f221e8eac1275f684698984c771730003938289889167e37cc810291c",
    "fileMatch": [
      "**/pack.mcmeta"
    ]
  },
  "type": "object",
  "properties": {
    "pack": {
      "description": "Holds the pack information.",
      "type": "object",
      "properties": {
        "description": {
          "$ref": "#/$defs/textComponent",
          "title": "description",
          "description": "A text component that appears when hovering over the pack's name in the list given by the `/datapack list` command, or when viewing the pack in the Create World screen."
        },
        "pack_format": {
          "$ref": "#/$defs/packFormat",
          "description": "Determines the version(s) of Minecraft that this pack is compatible with. Optional when supported formats do not include 82 (data pack) or 65 (resource pack) or below, but required otherwise."
        },
        "min_format": {
          "$ref": "#/$defs/packFormatMajorMinor",
          "description": "Describes the minimum supported pack format version. Can be an integer or an array of one or two integers ([major] or [major, minor])."
        },
        "max_format": {
          "$ref": "#/$defs/packFormatMajorMinor",
          "description": "Describes the maximum supported pack format version. Can be an integer or an array of one or two integers ([major] or [major, minor])."
        },
        "supported_formats": {
          "$ref": "#/$defs/packFormatRange",
          "description": "DEPRECATED. The major versions this pack supports. Has to match the major versions specified in min_format and max_format.\nRequired when the pack declares support for versions either below data pack format 82 or resource pack format 65.\nMust be absent otherwise."
        }
      },
      "anyOf": [
        {
          "properties": {
            "pack_format": {}
          },
          "required": [
            "pack_format"
          ],
          "type": "object"
        },
        {
          "properties": {
            "min_format": {},
            "max_format": {}
          },
          "required": [
            "min_format",
            "max_format"
          ],
          "type": "object"
        }
      ],
      "required": [
        "description"
      ],
      "additionalProperties": false
    },
    "features": {
      "description": "Section for selecting experimental features.",
      "type": "object",
      "properties": {
        "enabled": {
          "description": "List of enabled feature flags.",
          "type": "array",
          "items": {
            "$ref": "#/$defs/resourceLocation",
            "description": "Resource location of a feature flag."
          }
        }
      },
      "required": [
        "enabled"
      ],
      "additionalProperties": true
    },
    "filter": {
      "description": "Section for filtering out files from packs applied below this one. Any file that matches one of the blocked patterns is treated as if it was not present in the pack at all.",
      "type": "object",
      "properties": {
        "block": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "namespace": {
                "description": "A regular expression for the namespace of files to be filtered out. If unspecified, it applies to every namespace.",
                "type": "string",
                "format": "regex",
                "default": "[a-z0-9_\\-.]+"
              },
              "path": {
                "description": "A regular expression for the paths of files to be filtered out. If unspecified, it applies to every file.",
                "type": "string",
                "format": "regex",
                "default": "[a-z0-9_\\-./]+"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    },
    "overlays": {
      "description": "Section for specifying the overlays, which are sub-packs applied over the \"normal\" contents of a pack. Their directories have their own assets and data directories, and are placed in the pack's root directory.",
      "type": "object",
      "properties": {
        "entries": {
          "description": "List of overlays. The order is important, as the first in the list is applied first.",
          "type": "array",
          "items": {
            "description": "An overlay.",
            "type": "object",
            "properties": {
              "directory": {
                "description": "The directory to overlay for the respective versions.",
                "type": "string",
                "pattern": "[a-z0-9_-]+"
              },
              "min_format": {
                "$ref": "#/$defs/packFormatMajorMinor",
                "description": "Describes the minimum pack format version to which this overlay applies. As integer or one or two element integer array."
              },
              "max_format": {
                "$ref": "#/$defs/packFormatMajorMinor",
                "description": "Describes the minimum pack format version to which this overlay applies. As integer or one or two element integer array."
              },
              "formats": {
                "$ref": "#/$defs/packFormatRange",
                "description": "DEPRECATED. A range of major pack format versions to which this overlay applies. Has to match the major versions specified in min_format and max_format.\nRequired when the pack declares support for versions either below data pack format 82 or resource pack format 65.\nMust be absent otherwise."
              }
            },
            "anyOf": [
              {
                "properties": {
                  "formats": {}
                },
                "required": [
                  "formats"
                ],
                "type": "object"
              },
              {
                "properties": {
                  "min_format": {},
                  "max_format": {}
                },
                "required": [
                  "min_format",
                  "max_format"
                ],
                "type": "object"
              }
            ],
            "required": [
              "directory"
            ],
            "additionalProperties": false
          }
        }
      },
      "required": [
        "entries"
      ],
      "additionalProperties": false
    },
    "language": {
      "description": "Contains additional languages to add to the language menu. Only present in resource packs.",
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "name": {
            "description": "The full name of the language",
            "type": "string"
          },
          "region": {
            "description": "The country or region name",
            "type": "string"
          },
          "bidirectional": {
            "description": "If true, the language reads right to left.",
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "region"
        ],
        "additionalProperties": false
      }
    },
    "fusion": {
      "$comment": "Fusion properties for Minecraft resource packs",
      "$ref": "https://catalog.lintel.tools/schemas/schemastore/minecraft-data-pack-metadata/_shared/latest--partial-fusion-pack-metadata.json#/$defs/fusion-properties"
    }
  },
  "required": [
    "pack"
  ],
  "additionalProperties": false,
  "$defs": {
    "packFormat": {
      "description": "<https://minecraft.wiki/w/Pack_format>",
      "type": "integer",
      "minimum": 1,
      "maximum": 101
    },
    "packFormatMajorMinor": {
      "description": "A pack format version, specified as a single integer (major version) or an array of one or two integers ([major] or [major, minor]). Omitting the minor version is equal to specifying minor version 0.\n<https://minecraft.wiki/w/Pack_format>",
      "oneOf": [
        {
          "type": "integer",
          "description": "Major version as an integer. Interpreted as [major, 0].",
          "minimum": 1
        },
        {
          "type": "array",
          "description": "An array of [major] or [major, minor] version integers. The minor version is optional and assumed to be 0 if not specified.",
          "items": {
            "type": "integer",
            "minimum": 0
          },
          "minItems": 1,
          "maxItems": 2
        }
      ]
    },
    "packFormatRange": {
      "anyOf": [
        {
          "type": "array",
          "minItems": 2,
          "maxItems": 2,
          "items": {
            "$ref": "#/$defs/packFormat"
          }
        },
        {
          "$ref": "#/$defs/packFormat"
        },
        {
          "type": "object",
          "properties": {
            "min_inclusive": {
              "$ref": "#/$defs/packFormat"
            },
            "max_inclusive": {
              "$ref": "#/$defs/packFormat"
            }
          },
          "required": [
            "min_inclusive",
            "max_inclusive"
          ],
          "additionalProperties": false
        }
      ]
    },
    "textComponent": {
      "description": "A Minecraft text component (raw JSON text).\n<https://minecraft.wiki/w/Raw_JSON_text_format>",
      "oneOf": [
        {
          "type": "string"
        },
        {
          "type": "object"
        }
      ]
    },
    "resourceLocation": {
      "description": "An identifier of a game object\n<https://minecraft.wiki/w/Resource_location>",
      "type": "string",
      "pattern": "(?:([a-z0-9_\\-.]+:)?|:)[a-z0-9_\\-./]+"
    }
  }
}
