{
  "$id": "blockception.minecraft.behavior.entities.type.trigger",
  "title": "Trigger",
  "description": "Trigger to fire.",
  "examples": [
    "event:example",
    {
      "filters": [],
      "target": "self",
      "event": "to:foo"
    }
  ],
  "defaultSnippets": [
    {
      "label": "New Trigger",
      "body": "^\"$1\""
    },
    {
      "label": "New Trigger - Filtered",
      "body": { "event": "$1", "target": "self", "filters": [{ "test": "$2", "value": "$3" }] }
    }
  ],
  "definitions": {
    "trigger": {
      "type": "object",
      "title": "Trigger",
      "additionalProperties": false,
      "properties": {
        "event": { "type": "string", "description": "The event to run when the conditions for this trigger are met.", "title": "Event" },
        "filters": {
          "$ref": "../../filters/filters.json",
          "description": "The list of conditions for this trigger to execute."
        },
        "target": { "$ref": "../../filters/filters/types/subject.json", "description": "The target of the event.", "title": "Target" }
      }
    }
  },
  "oneOf": [
    { "type": "string" },
    {
      "type": "object",
      "$ref": "#/definitions/trigger"
    },
    {
      "type": "array",
      "items": {
        "$ref": "#/definitions/trigger"
      }
    }
  ]
}
