{
  "format_version": "1.18.20",
  "minecraft:entity": {
    "description": {
      "identifier": "hd:automaton_commisar",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
                "scripts": {
        "animate": [
          "song"
        ]
      },
      "animations": {
        "song": "controller.animation.automaton_song"
      }
    },
    "component_groups": {
        "follow":{
            "minecraft:follow_range": {
                "value": 60,
                "max": 60
      }
        },
        "melee":{
            "minecraft:attack": {
                "damage": 10
            },
            "minecraft:behavior.melee_attack":{
                "priority":1,
                "melee_fov":90,
                "cooldown_time":1,
                "speed_multiplier":1,
                "track_target":false,
                "attack_types":"minecraft:player",
                "reach_multiplier":4,
                "attack_once":false
}
        },
        "range":{
      "minecraft:shooter": {
        "def": "hd:automaton_laser"
      },
      "minecraft:behavior.ranged_attack": {
        "priority": 0,
        "target_in_sight_time":2,
        "attack_interval_min": 0.8,
        "attack_interval_max": 2.5,
        "attack_radius": 40.0,
        "burst_shots":1,
        "burst_interval":0.1
      }
        },
        "def":{
      "minecraft:movement": {
        "value": 0.18
      },
            "minecraft:mark_variant":{
                "value": 0
            }
        },
        "aim":{
      "minecraft:movement": {
        "value": 0.22
      },
            "minecraft:mark_variant":{
                "value": 1
            }
        }
    },

    "components": {
            "minecraft:attack": {
                "damage": 10
            },
            "minecraft:behavior.melee_attack":{
                "priority":0,
                "melee_fov":90,
                "cooldown_time":1,
                "speed_multiplier":1,
                "track_target":false,
                "attack_types":"minecraft:player",
                "reach_multiplier":4,
                "attack_once":false
},
        "minecraft:variant":{
            "value":1
        },
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 2
      },
      "minecraft:type_family": {
        "family": [ "automaton","mob" ]
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0,
        "breathes_water": false
      },

      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": { "test": "in_lava", "subject": "self", "operator": "==", "value": true },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:movement": {
        "value": 0.2
      },
      "minecraft:navigation.walk": {
        "is_amphibious": true,
        "avoid_water": true
      },
      "minecraft:movement.basic": {
      },
      "minecraft:jump.static": {
      },
      "minecraft:nameable": {
      },
      "minecraft:knockback_resistance": {
        "value": 100
      },
      "minecraft:behavior.ranged_attack": {
        "priority": 0,
        "target_in_sight_time":2,
        "attack_interval_min": 0.8,
        "attack_interval_max": 2.5,
        "attack_radius": 40.0,
        "burst_shots":1,
        "burst_interval":0.1
      },
      "minecraft:environment_sensor": {
        "triggers": [
          {
            "filters": {
              "test": "distance_to_nearest_player",
              "subject":"target",
              "operator": ">",
              "value": 20
            },
            "event": "follow"
          },
          {
            "filters": {
              "test": "distance_to_nearest_player",
              "subject":"target",
              "operator": "<=",
              "value": 20
            },
            "event": "unfollow"
          },
          {
            "filters": {
              "test": "has_target",
              "operator": "==",
              "value": true
            },
            "event": "aim"
          },
          {
            "filters": {
              "test": "has_target",
              "operator": "==",
              "value": false
            },
            "event": "def"
          }
        ]
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 3,
        "alert_same_type":true,
        "entity_types": {
            "filters": {
                "test": "is_family",
                "subject": "other",
                "operator": "!=",
                "value": "automaton"
        }
    }
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 2,
        "must_see": true,
        "reselect_targets": true,
        "entity_types": [
          {
            "filters": {
              "test": "is_family",
              "subject": "other",
              "value": "player"
            },
            "max_dist": 60
          }
        ]
      },
      "minecraft:behavior.random_stroll": {
        "priority": 6,
        "speed_multiplier": 1
      },
      "minecraft:behavior.look_at_player": {
        "priority": 7,
        "look_distance": 20
      },
      "minecraft:behavior.random_look_around": {
          "angle_of_view_horizontal":180,
          "angle_of_view_vertical":150,
        "priority": 8
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },

    "events": {
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "def",
            "range",
            "melee"
          ]
        },
        "run_command":{
            "command":[
                "scoreboard objectives add sing_count dummy"]
        }
      },
      "follow": {
        "add": {
          "component_groups": [
            "follow"
          ]
        }
      },
      "unfollow": {
        "remove": {
          "component_groups": [
            "follow"
          ]
        }
      },
      "melee": {
        "remove": {
          "component_groups": [
            "range"
          ]
        },
        "add": {
          "component_groups": [
            "melee"
          ]
        }
      },
      "range": {
        "remove": {
          "component_groups": [
            "melee"
          ]
        },
        "add": {
          "component_groups": [
            "range"
          ]
        }
      },
      "def": {
        "add": {
          "component_groups": [
            "def"
          ]
        }
      },
      "aim": {
        "add": {
          "component_groups": [
            "aim"
          ]
        }
      }
    }
  }
}