{
  "format_version": "1.20.50",
  "minecraft:entity": {
    "description": {
      "identifier": "cc_alien:droid_salvaged",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "scripts": {
        "animate": [
          "crash_on_damage"
        ]
      },
      "animations": {
        "wait_15sec": "animation.cc_alien.droid_salvaged.wait_15sec",
        "crash_on_damage": "controller.animation.cc_alien.droid_salvaged.crash_on_damage"
      },
      "properties": {
        "cc_alien:crashed": {
          "default": false,
          "type": "bool",
          "client_sync": true
        }
      }
    },
    "components": {
      "minecraft:health": {
        "min": -1,
        "max": 40
      },
      "minecraft:ambient_sound_interval": {
        "event_name": "ambient",
        "value": 2.0
      },
      "minecraft:collision_box": {
        "height": 1.9,
        "width": 0.7
      },
      "minecraft:physics": {},
      "minecraft:attack": {
        "damage": 6
      },
      "minecraft:type_family": {
        "family": [
          "cc_alien_friend",
          "cc_alien_droid"
        ]
      }
    },
    "component_groups": {
      "attack_components": {
        "minecraft:lookat": {
          "look_cooldown": [
            5.0,
            5.0
          ],
          "filters": {
            "any_of": [
              {
                "test": "is_family",
                "operator": "equals",
                "subject": "other",
                "value": "cc_alien_monster"
              }
            ]
          },
          "search_radius": 24.0,
          "set_target": true,
          "allow_invulnerable": true
        },
        "minecraft:behavior.nearest_prioritized_attackable_target": {
          "must_reach": false,
          "must_see_forget_duration": 15,
          "reselect_targets": true,
          "scan_interval": 10,
          "target_search_height": -1,
          "within_radius": 30,
          "priority": 1,
          "entity_types":[
            {
              "priority": 0,
              "filters": {
                "test": "is_family",
                "subject": "other",
                "value": "cc_alien_monster"
              },
              "max_dist": 50
            },
            {
              "priority": 0,
              "filters": {
                "test": "is_family",
                "subject": "other",
                "operator": "==",
                "value": "monster"
              },
              "max_dist": 20
            }
          ]
        },
        "minecraft:timer": {
          "time": [
            5,
            10
          ],
          "time_down_event": {
            "event": "roll_attack_pattern",
            "target": "self"
          },
          "looping": true,
          "randomInterval": true
        }
      },
      "attack_right": {
        "minecraft:behavior.delayed_attack": {
          "priority": 2,
          "reach_multiplier": 3.0,
          "speed_multiplier": 1.2,
          "attack_duration": 0.6,
          "hit_delay_pct": 0.3
        },
        "minecraft:attack": {
          "damage": 3
        },
        "minecraft:movement": {
          "value": 0.25
        },
        "minecraft:variant": {
          "value": 1
        }
      },
      "attack_left": {
        "minecraft:behavior.delayed_attack": {
          "priority": 2,
          "reach_multiplier": 3.0,
          "speed_multiplier": 1.2,
          "attack_duration": 0.6,
          "hit_delay_pct": 0.3
        },
        "minecraft:attack": {
          "damage": 3
        },
        "minecraft:movement": {
          "value": 0.25
        },
        "minecraft:variant": {
          "value": 2
        }
      },
      "attack_smash": {
        "minecraft:behavior.delayed_attack": {
          "priority": 2,
          "reach_multiplier": 2.1,
          "speed_multiplier": 1.2,
          "attack_duration": 0.7,
          "hit_delay_pct": 0.35
        },
        "minecraft:attack": {
          "damage": 6
        },
        "minecraft:movement": {
          "value": 0.25
        },
        "minecraft:variant": {
          "value": 3
        }
      },
      "ranged_group": {
        "minecraft:behavior.ranged_attack": {
          "priority": 3,
          "charge_charged_trigger": 1.5,
          "charge_shoot_trigger": 1.5,
          "attack_radius": 22.0
        },
        "minecraft:shooter": {
          "def": "cc_alien:goo_projectile"
        },
        "minecraft:movement": {
          "value": 0.0
        }
      },
      "ranged_left": {
        "minecraft:variant": {
          "value": 4
        }
      },
      "ranged_right": {
        "minecraft:variant": {
          "value": 5
        }
      },
      "default_skin": {
        "minecraft:skin_id": {
          "value": 0
        }
      },
      "orange_skin": {
        "minecraft:skin_id": {
          "value": 1
        }
      },
      "green_skin": {
        "minecraft:skin_id": {
          "value": 2
        }
      },
      "red_skin": {
        "minecraft:skin_id": {
          "value": 3
        }
      },
      "blue_skin": {
        "minecraft:skin_id": {
          "value": 4
        }
      },
      "black_skin": {
        "minecraft:skin_id": {
          "value": 5
        },
        "minecraft:health": {
          "value": 40,
          "max": 40
        }
      },
      "move_components": {
        "minecraft:pushable": {},
        "minecraft:behavior.float": {
          "priority": 1
        },
        "minecraft:jump.static": {},
        "minecraft:navigation.walk": {},
        "minecraft:movement.basic": {},
        "minecraft:behavior.random_stroll": {
          "priority": 5,
          "speed_multiplier": 0.7,
          "xz_dist": 10,
          "y_dist": 3
        },
        "minecraft:behavior.random_look_around": {
          "priority": 6
        },
        "minecraft:movement": {
          "value": 0.3
        }
      },
      "crashed": {
        "minecraft:health": {
          "min": 0,
          "max": 0
        },
        "minecraft:knockback_resistance": {
          "value": 1.0
        },
        "minecraft:pushable": {
          "is_pushable": false,
          "is_pushable_by_piston": true
        },
        "minecraft:movement.basic": {},
        "minecraft:movement": {
          "value": 0
        }
      }
    },
    "events": {
      "roll_attack_pattern": {
        "sequence": [
          {
            "remove": {
              "component_groups": [
                "attack_right",
                "attack_left",
                "attack_smash",
                "ranged_left",
                "ranged_right",
                "ranged_group"
              ]
            }
          },
          {
            "randomize": [
              {
                "weight": 2,
                "add": {
                  "component_groups": [
                    "attack_right"
                  ]
                }
              },
              {
                "weight": 2,
                "add": {
                  "component_groups": [
                    "attack_left"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "attack_smash"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "ranged_left",
                    "ranged_group"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "ranged_right",
                    "ranged_group"
                  ]
                }
              }
            ]
          },
          {}
        ]
      },
      "on_crash": {
        "remove": {
          "component_groups": [
            "move_components",
            "attack_components"
          ]
        },
        "add": {
          "component_groups": [
            "crashed"
          ]
        },
        "set_property": {
          "cc_alien:crashed": true
        }
      },
      "minecraft:entity_spawned": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "move_components",
                "attack_components"
              ]
            }
          },
          {
            "randomize": [
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "default_skin"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "orange_skin"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "green_skin"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "red_skin"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "blue_skin"
                  ]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": [
                    "black_skin"
                  ]
                }
              }
            ]
          }
        ]
      }
    }
  }
}