{
  "$id": "blockception.minecraft.behavior.entities.minecraft.behavior.move_to_block",
  "type": "object",
  "title": "Move To Block",
  "additionalProperties": false,
  "description": "Allows mob to move towards a block.",
  "required": [],
  "properties": {
    "priority": { "$ref": "./types/priority.json" },

    "goal_radius": {
      "title": "Goal Radius",
      "type": "number",
      "default": 0.5,
      "description": "Distance in blocks within the mob considers it has reached the goal. This is the \"wiggle room\" to stop the AI from bouncing back and forth trying to reach a specific spot"
    },
    "on_stay_completed": {
      "title": "On Stay Completed",
      "description": "Event to run on completing a stay of stay_duration at the block.",
      "$ref": "../types/trigger.json"
    },
    "on_reach": {
      "title": "On Reach",
      "description": "Event to run on block reached.",
      "$ref": "../types/trigger.json"
    },
    "start_chance": {
      "title": "Start Chance",
      "type": "number",
      "default": 1.0,
      "description": "Chance to start the behavior (applied after each random tick_interval)."
    },
    "search_range": {
      "title": "Search Range",
      "type": "integer",
      "default": 0,
      "description": "The distance in blocks that the mob will look for the block."
    },
    "search_height": {
      "title": "Search Height",
      "type": "integer",
      "default": 1,
      "description": "The height in blocks that the mob will look for the block."
    },
    "stay_duration": {
      "title": "Stay Duration",
      "type": "number",
      "default": 0.0,
      "description": "Number of ticks needed to complete a stay at the block."
    },
    "target_selection_method": {
      "title": "Target Selection Method",
      "type": "string",
      "default": "nearest",
      "description": "Kind of block to find fitting the specification. Valid values are \"random\" and \"nearest\".",
      "enum": ["random", "nearest"]
    },
    "target_offset": {
      "title": "Target Offset",
      "type": "array",
      "default": [0, 0, 0],
      "description": "Offset to add to the selected target position.",
      "items": [
        { "type": "number", "title": "X" },
        { "type": "number", "title": "Y" },
        { "type": "number", "title": "Z" }
      ]
    },
    "target_blocks": {
      "type": "array",
      "title": "Target Blocks",
      "description": "Block types to move to.",
      "items": {
        "$ref": "../../../../general/item/descriptor.json"
      }
    },
    "target_block_filters": {
      "title": "Target Block Filters",
      "description": "Filters to apply on the target blocks. Target blocks are only valid if the filters are true.",
      "$comment": "UNDOCUMENTED",
      "$ref": "../../filters/filters.json"
    },
    "tick_interval": {
      "title": "Tick Interval",
      "type": "integer",
      "default": 20,
      "description": "Average interval in ticks to try to run this behavior."
    }
  },
  "examples": [
    {
      "start_chance": 1,
      "search_range": 32,
      "goal_radius": 3,
      "stay_duration": 2,
      "target_blocks": ["minecraft:chest"]
    }
  ]
}
