{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "hoh_bht:quest_giver",
      "is_spawnable": false,
      "is_summonable": true,
      "is_experimental": false,
      "animations": {
        "dialogue": "animation.hoh_bht.dialogue.start_quest",
        "dialogue_researcher": "animation.hoh_bht.dialogue.start_quest_researcher",
        "dialogue_miner": "animation.hoh_bht.dialogue.start_quest_miner",
        "dialogue_shady": "animation.hoh_bht.dialogue.start_quest_shady"
      },
      "scripts": {
        "animate": [
          {
            "dialogue_researcher": "query.variant == 1"
          },
          {
            "dialogue_miner": "query.variant == 2"
          },
          {
            "dialogue_shady": "query.variant == 3"
          }
        ]
      }
    },
    "component_groups": {
      "hoh_bht:despawn": {
        "minecraft:despawn": {
          "filters": {
            "all_of": [
              {
                "test": "is_riding",
                "operator": "=",
                "value": false
              }
            ]
          }
        }
      },
      "hoh_bht:met_before_researcher": {
        "minecraft:skin_id":{
          "value": 1
        }
      },
      "hoh_bht:met_before_miner": {
        "minecraft:skin_id":{
          "value": 2
        }
      },
      "hoh_bht:met_before_shady": {
        "minecraft:skin_id":{
          "value": 3
        }
      },
      "hoh_bht:surprised": {
        "minecraft:is_illager_captain":{
        }
      },
      "hoh_bht:talking": {
        "minecraft:mark_variant":{
          "value": 1
        }
      },
      "hoh_bht:leave": {
        "minecraft:mark_variant":{
          "value": 2
        },
        "minecraft:interact": {
          "interactions": [
            {
              "on_interact": {
                "filters": [
                  {
                    "all_of": [
                      {
                        "test": "is_family",
                        "subject": "other",
                        "value": "player"
                      }
                    ]
                  }
                ],
                "target": "self",
                "event": "hoh_bht:triggerd"
              }
            }
          ]
        },
        "minecraft:timer": {
          "time": [
            3.0,
            3.0
          ],
          "looping": false,
          "time_down_event": {
            "event": "hoh_bht:despawn",
            "target": "self"
          }
        }
      },
      "hoh_bht:not_talking": {
        "minecraft:mark_variant":{
          "value": 3
        }
      },
      "hoh_bht:researcher": {
        "minecraft:variant": {
          "value": 1
        },
        "minecraft:despawn": {
          "filters": {
            "any_of": [
              {
                "all_of": [
                  {
                    "test": "is_brightness",
                    "operator": "<",
                    "value": 0.49
                  },
                  {
                    "test": "is_mark_variant",
                    "operator": "!=",
                    "value": 1
                  }
                ]
              },
              {
                "test": "distance_to_nearest_player",
                "operator": ">",
                "value": 45
              }
            ]
          }
        }
      },
      "hoh_bht:miner": {
        "minecraft:variant": {
          "value": 2
        },
        "minecraft:despawn": {
          "filters": {
            "all_of": [
              {
                "test": "is_riding",
                "operator": "=",
                "value": false
              },
              {
                "test": "distance_to_nearest_player",
                "operator": ">",
                "value": 45
              }
            ]
          }
        }
      },
      "hoh_bht:shady": {
        "minecraft:variant": {
          "value": 3
        },
        "minecraft:despawn": {
          "filters": {
            "any_of": [
              {
                "all_of": [
                  {
                    "test": "is_brightness",
                    "operator": ">",
                    "value": 0.49
                  },
                  {
                    "test": "is_mark_variant",
                    "operator": "!=",
                    "value": 1
                  }
                ]
              },
              {
                "test": "distance_to_nearest_player",
                "operator": ">",
                "value": 45
              }
            ]
          }
        }
      },
      "hoh_bht:triggerd": {
        "minecraft:is_baby": {}
      }
    },
    "components": {
      "minecraft:persistent":{},
      "minecraft:behavior.rise_to_liquid_level": {
        "priority": 1,
        "liquid_y_offset": 0.25,
        "rise_delta": 0.01,
        "sink_delta": 0.01
      },
      "minecraft:npc": {
        "npc_data": {
          "portrait_offsets": {
            "translate": [
              0,
              50.0,
              0
            ],
            "scale": [
              1.75,
              1.75,
              1.75
            ]
          },
          "picker_offsets": {
            "translate": [
              0,
              10,
              0
            ],
            "scale": [
              1.7,
              1.7,
              1.7
            ]
          }
        }
      },
      "minecraft:type_family": {
        "family": [
          "quest_giver",
          "mob",
          "inanimate"
        ]
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0,
        "breathes_water": true,
        "breathes_air": true,
        "generates_bubbles": false
      },
      "minecraft:jump.static": {},
      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "minecraft:movement.basic": {},
      "minecraft:navigation.generic": {
        "avoid_damage_blocks": true,
        "can_pass_doors": true,
        "can_jump": true,
        "can_sink": false
      },
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 2.0
      },
      "minecraft:movement": {
        "value": 0,
        "max": 0
      },
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "on_damage": {
            },
            "deals_damage": false
          }
        ]
      },
      "minecraft:nameable": {},
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:behavior.look_at_player": {
        "priority": 4,
        "target_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:target_nearby_sensor": {
        "inside_range": 5.5,
        "on_inside_range": {
          "event": "hoh_bht:player_nearby",
          "target": "self"
        }
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 0,
        "entity_types": [
          {
            "filters": {
              "any_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "player"
                }
              ]
            },
            "max_dist": 6.0,
            "attack_interval": 10
          }
        ]
      },
      "minecraft:conditional_bandwidth_optimization": {}
    },
    "events": {
      "hoh_bht:despawn":{
        "add": {
          "component_groups": ["hoh_bht:despawn"]
        }
      },
      "hoh_bht:delivered":{
        "remove": {
          "component_groups": ["hoh_bht:talking"]
        },
        "add": {
          "component_groups": ["hoh_bht:leave"]
        }
      },
      "minecraft:entity_spawned":{
        "sequence": [
          {
            "filters": {
              "test": "is_altitude",
              "subject": "self",
              "operator": "<",
              "value": 20
            },
            "add": {
              "component_groups": [
                "hoh_bht:miner"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_altitude",
                  "subject": "self",
                  "operator": ">=",
                  "value": 20
                },
                {
                  "test": "is_brightness",
                  "operator": ">",
                  "value": 0.49
                }
              ]
            },
            "add": {
              "component_groups": [
                "hoh_bht:researcher"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_altitude",
                  "subject": "self",
                  "operator": ">=",
                  "value": 20
                },
                {
                  "test": "is_brightness",
                  "operator": "<",
                  "value": 0.49
                }
              ]
            },
            "add": {
              "component_groups": [
                "hoh_bht:shady"
              ]
            }
          }
        ]
      },
      "hoh_bht:player_nearby":{
        "sequence": [
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_tag",
                  "subject": "other",
                  "operator": "not",
                  "value": "met_before_researcher"
                },
                {
                  "test": "is_variant",
                  "subject": "self",
                  "operator": "equals",
                  "value": 1
                }
              ]
            },
            "add": {
              "component_groups": [
                   "hoh_bht:surprised"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_tag",
                  "subject": "other",
                  "operator": "not",
                  "value": "met_before_miner"
                },
                {
                  "test": "is_variant",
                  "subject": "self",
                  "operator": "equals",
                  "value": 2
                }
              ]
            },
            "add": {
              "component_groups": [
                   "hoh_bht:surprised"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_tag",
                  "subject": "other",
                  "operator": "not",
                  "value": "met_before_shady"
                },
                {
                  "test": "is_variant",
                  "subject": "self",
                  "operator": "equals",
                  "value": 3
                }
              ]
            },
            "add": {
              "component_groups": [
                   "hoh_bht:surprised"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_tag",
                  "subject": "other",
                  "operator": "equals",
                  "value": "met_before_researcher"
                },
                {
                  "test": "is_variant",
                  "subject": "self",
                  "operator": "equals",
                  "value": 1
                }
              ]
            },
            "remove": {
              "component_groups": [
                   "hoh_bht:surprised"
              ]
            },
            "add": {
              "component_groups": [
                   "hoh_bht:met_before_researcher"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_tag",
                  "subject": "other",
                  "operator": "equals",
                  "value": "met_before_miner"
                },
                {
                  "test": "is_variant",
                  "subject": "self",
                  "operator": "equals",
                  "value": 2
                }
              ]
            },
            "remove": {
              "component_groups": [
                   "hoh_bht:surprised"
              ]
            },
            "add": {
              "component_groups": [
                   "hoh_bht:met_before_miner"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_tag",
                  "subject": "other",
                  "operator": "equals",
                  "value": "met_before_shady"
                },
                {
                  "test": "is_variant",
                  "subject": "self",
                  "operator": "equals",
                  "value": 3
                }
              ]
            },
            "remove": {
              "component_groups": [
                   "hoh_bht:surprised"
              ]
            },
            "add": {
              "component_groups": [
                   "hoh_bht:met_before_shady"
              ]
            }
          }
        ]
      },
      "hoh_bht:dialogue_start":{
        "add": {
          "component_groups": ["hoh_bht:talking"]
        }
      },
      "hoh_bht:dialogue_end":{
        "remove": {
          "component_groups": ["hoh_bht:talking"]
        },
        "add": {
          "component_groups": ["hoh_bht:not_talking"]
        }
      },
      "hoh_bht:triggerd": {
        "add": {
          "component_groups": [
            "hoh_bht:triggerd"
          ]
        }
      },
      "hoh_bht:researcher": {
        "add": {
          "component_groups": [
            "hoh_bht:researcher"
          ]
        }
      },
      "hoh_bht:miner": {
        "add": {
          "component_groups": [
            "hoh_bht:miner"
          ]
        }
      },
      "hoh_bht:shady": {
        "add": {
          "component_groups": [
            "hoh_bht:shady"
          ]
        }
      }
    }
  }
}