{
  "$comment": "https://minecraft.wiki/w/Advancement/JSON_format",
  "$id": "https://json.schemastore.org/minecraft-advancement.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "definitions": {
    "jsonTextComponent": {
      "$comment": "https://minecraft.wiki/w/Raw_JSON_text_format",
      "type": ["string", "boolean", "number", "array", "object"],
      "properties": {
        "extra": {
          "description": "A list of additional raw JSON text components to be displayed after this one.",
          "type": "array",
          "items": {
            "description": "A child text component. Child text components inherit all formatting and interactivity from the parent component, unless they explicitly override them.",
            "$ref": "#/definitions/jsonTextComponent"
          }
        },
        "color": {
          "description": "The color to render the content in.",
          "type": "string",
          "anyOf": [
            {
              "enum": [
                "black",
                "dark_blue",
                "dark_green",
                "dark_aqua",
                "dark_red",
                "dark_purple",
                "gold",
                "gray",
                "dark_gray",
                "blue",
                "green",
                "aqua",
                "red",
                "light_purple",
                "yellow",
                "white",
                "reset"
              ]
            },
            {
              "pattern": "#[A-F\\d]{6}"
            }
          ]
        },
        "font": {
          "description": "The resource location of the font for this component in the resource pack within assets/<namespace>/font.",
          "type": "string",
          "default": "minecraft:default"
        },
        "bold": {
          "description": "Whether to render the content in bold.",
          "type": "boolean"
        },
        "italic": {
          "description": "Whether to render the content in italics. Note that text that is italicized by default, such as custom item names, can be unitalicized by setting this to false.",
          "type": "boolean"
        },
        "underlined": {
          "description": "Whether to underline the content.",
          "type": "boolean"
        },
        "strikethrough": {
          "description": "Whether to strikethrough the content.",
          "type": "boolean"
        },
        "obfuscated": {
          "description": "Whether to render the content obfuscated.",
          "type": "boolean"
        },
        "insertion": {
          "description": "When the text is shift-clicked by a player, this string is inserted in their chat input. It does not overwrite any existing text the player was writing. This only works in chat messages.",
          "type": "string"
        },
        "clickEvent": {
          "title": "click event",
          "description": "Allows for events to occur when the player clicks on text. Only work in chat messages and written books, unless specified otherwise.",
          "type": "object",
          "properties": {
            "action": {
              "description": "The action to perform when clicked.",
              "type": "string",
              "enum": [
                "open_url",
                "open_file",
                "run_command",
                "suggest_command",
                "change_page",
                "copy_to_clipboard"
              ]
            },
            "value": {
              "description": "The URL, file path, chat, command or book page used by the specified action.",
              "type": "string"
            }
          }
        },
        "hoverEvent": {
          "title": "hover event",
          "description": "Allows for a tooltip to be displayed when the player hovers their mouse over text.",
          "type": "object",
          "properties": {
            "action": {
              "description": "The type of tooltip to show.",
              "type": "string",
              "enum": ["show_text", "show_item", "show_entity"]
            },
            "value": {
              "description": "The formatting and type of this tag varies depending on the action.",
              "type": "string"
            },
            "contents": {
              "title": "contents",
              "description": "The formatting of this tag varies depending on the action.",
              "type": "object"
            }
          }
        },
        "text": {
          "description": "A string containing plain text to display directly. Can also be a number or boolean that is displayed directly.",
          "type": ["string", "number", "boolean"]
        },
        "translate": {
          "description": "A translation identifier, corresponding to the identifiers found in loaded language files. Displayed as the corresponding text in the player's selected language. If no corresponding translation can be found, the identifier itself is used as the translated text.",
          "type": "string"
        },
        "with": {
          "description": "A list of raw JSON text components to be inserted into slots in the translation text.",
          "type": "array",
          "items": {
            "description": "A raw JSON text component. If no component is provided for a slot, the slot is displayed as no text.",
            "$ref": "#/definitions/jsonTextComponent"
          }
        }
      }
    }
  },
  "description": "A data pack advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
  "properties": {
    "display": {
      "title": "display",
      "description": "Display options for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
      "type": "object",
      "properties": {
        "icon": {
          "title": "icon",
          "description": "Icon options for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "object",
          "properties": {
            "item": {
              "description": "An item identifier for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
              "type": "string",
              "minLength": 1
            },
            "nbt": {
              "description": "A named binary tag of an item for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
              "type": "string",
              "minLength": 1
            }
          }
        },
        "title": {
          "title": "title",
          "description": "A title for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "$ref": "#/definitions/jsonTextComponent"
        },
        "frame": {
          "description": "A frame type for the icon for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "string",
          "enum": ["challenge", "goal", "task"],
          "default": "task"
        },
        "background": {
          "description": "A background directory for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "$ref": "https://json.schemastore.org/base.json#/definitions/path"
        },
        "description": {
          "title": "description",
          "description": "A description for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "$ref": "#/definitions/jsonTextComponent"
        },
        "show_toast": {
          "description": "Whether or not to show the toast pop up after completing the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "boolean",
          "default": true
        },
        "annouce_to_chat": {
          "description": "Whether or not to announce in the chat when the current advancement has been completed\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "boolean",
          "default": true
        },
        "hidden": {
          "description": "Whether or not to hide this advancement and all its children from the advancement screen until the current advancement have been completed\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "boolean",
          "default": false
        }
      }
    },
    "parent": {
      "description": "A parent directory for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
      "$ref": "https://json.schemastore.org/base.json#/definitions/path"
    },
    "criteria": {
      "title": "criteria",
      "description": "Required criteria have to be met for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
      "type": "object",
      "additionalProperties": {
        "title": "criteria",
        "description": "Required criteria have to be met for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
        "type": "object",
        "properties": {
          "trigger": {
            "description": "A trigger for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Criteria",
            "type": "string"
          },
          "conditions": {
            "description": "Conditions need to be met when the trigger gets activated for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Criteria",
            "type": "object",
            "properties": {
              "player": {
                "title": "player options",
                "description": "Check properties of the player for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Criteria",
                "type": ["array", "object"]
              }
            }
          }
        }
      }
    },
    "requirements": {
      "description": "Requirements for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
      "type": "array",
      "uniqueItems": true,
      "items": {
        "description": "Criterions for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
        "type": "array",
        "uniqueItems": true,
        "items": {
          "description": "Criterion name for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "string",
          "minLength": 1
        }
      }
    },
    "rewards": {
      "title": "rewards",
      "description": "Rewards for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
      "type": "object",
      "properties": {
        "recipes": {
          "description": "Recipes to unlock for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "description": "A namespaced identifier for a recipe for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
            "type": "string",
            "minLength": 1
          }
        },
        "loot": {
          "description": "Loot tables to give to the player for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "array",
          "uniqueItems": true,
          "items": {
            "description": "A namespaced identifier for a loot table for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
            "type": "string",
            "minLength": 1
          }
        },
        "experience": {
          "description": "An experience amount for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "integer",
          "minimum": 0
        },
        "function": {
          "description": "A function to run for the current advancement\nhttps://minecraft.wiki/w/Advancement/JSON_format#Legend",
          "type": "string",
          "minLength": 1
        }
      },
      "additionalProperties": false
    }
  },
  "title": "data pack advancement",
  "type": "object"
}
