{
  "format_version": "1.20.50",
  "minecraft:entity": {
    "description": {
      "identifier": "cc_alien:ufo_normal",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "scripts": {
        "animate": [
          "crash_on_damage",
          { "summon_beacon": "!q.property('cc_alien:crashed')" },
          {
            "levitate": "!(query.property(\u0027cc_alien:crashed\u0027))"
          },
          {
            "tp_cows": "!(query.property(\u0027cc_alien:crashed\u0027))"
          }
        ]
      },
      "animations": {
        "crash_on_damage": "controller.animation.cc_alien.ufo_normal.crash_on_damage",
        "wait_7s": "animation.cc_alien.ufo_normal.wait_7s",
        "summon_beacon": "controller.animation.cc_alien.ufo_normal.summon_beacon",
        "levitate": "controller.animation.cc_alien.ufo_normal.levitate",
        "tp_cows": "controller.animation.cc_alien.ufo_normal.tp_cows"
      },
      "properties": {
        "cc_alien:crashed": {
          "default": false,
          "type": "bool",
          "client_sync": true
        },
        "cc_alien:beacon_summoned": {
          "default": false,
          "type": "bool"
        },
        "cc_alien:has_taken_damage": {
          "default": false,
          "type": "bool",
          "client_sync": true
        },
        "cc_alien:beam": {
          "default": false,
          "type": "bool",
          "client_sync": true
        }
      }
    },
    "components": {
      "minecraft:health": {
        "min": 9,
        "max": 25
      },
      "minecraft:experience_reward": {
        "on_death": "15"
      },
      "minecraft:loot": {
        "table": "loot_tables/cc/alien/entities/ufo.json"
      },
      "minecraft:type_family": {
        "family": [
          "cc_alien_monster"
        ]
        
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": false,
        "is_pushable_by_piston": true
      },
      "minecraft:collision_box": {
        "height": 2.0,
        "width": 2.0
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "on_damage": {
              "event": "on_damage_taken_player",
              "filters": {
                "any_of": [
                  {
                    "test": "is_family",
                    "operator": "equals",
                    "subject": "other",
                    "value": "player"
                  },
                  {
                    "test": "is_family",
                    "subject": "damager",
                    "value": "arrow"
                  }
                ]
              }
            },
            "cause": "all"
          },
          {
            "cause": "fall",
            "deals_damage": false
          }
        ]
      }
    },
    "component_groups": {
      "crashed": {
        "minecraft:health": {
          "min": 0,
          "max": 30
        },
        "minecraft:knockback_resistance": {
          "value": 1.0
        },
        "minecraft:pushable": {
          "is_pushable": false,
          "is_pushable_by_piston": true
        },
        "minecraft:movement": {
          "value": 0
        }
      },
      "attack_components": {
        "minecraft:lookat": {
          "look_cooldown": [5.0, 5.0],
          "filters": {
            "test": "is_family",
            "operator": "equals",
            "subject": "other",
            "value": "player"
          },
          "search_radius": 64.0,
          "set_target": true,
          "allow_invulnerable": true
        },
        "minecraft:behavior.look_at_entity": {
          "priority": 4,
          "look_distance": 64.0,
          "probability": 1.0
        },
        "minecraft:behavior.hurt_by_target": {
          "priority": 1
        },
        "minecraft:behavior.nearest_attackable_target": {
          "entity_types": [
            {
              "filters": {
                "test": "is_family",
                "operator": "equals",
                "subject": "other",
                "value": "mob"
              },
              "max_dist": 5
            },
            {
              "filters": {
                "test": "is_family",
                "operator": "equals",
                "subject": "other",
                "value": "player"
              },
              "max_dist": 50
            }
          ],
          "priority": 2,
          "must_see": true,
          "within_radius": 64.0,
          "must_see_forget_duration": 60.0,
          "must_reach": false,
          "attack_interval": 10
        },
        "minecraft:shooter": {
          "def": "cc_alien:tnt_projectile"
        },
        "minecraft:behavior.ranged_attack": {
          "priority": 3,
          "charge_charged_trigger": 8.0,
          "charge_shoot_trigger": 3.0,
          "attack_radius": 64.0
        }
      },
      "move_components": {
        "minecraft:follow_range": {
          "value": 64,
          "max": 64
        },
        "minecraft:navigation.float": {
          "can_path_over_water": true
        },
        "minecraft:behavior.float_wander": {
          "priority": 3,
          "xz_dist": 10,
          "y_dist": 4,
          "y_offset": -0.1,
          "float_duration": true,
          "must_reach": false,
          "random_reselect": true
        },
        "minecraft:behavior.float": {
          "priority": 0
        },
        "minecraft:can_fly": {},
        "minecraft:jump.static": {},
        "minecraft:movement": {
          "value": 0.03
        }
      },
      "variant_0": {
        "minecraft:variant": {
          "value": 0
        }
      },
      "variant_1": {
        "minecraft:variant": {
          "value": 1
        }
      },
      "variant_2": {
        "minecraft:variant": {
          "value": 2
        }
      },
      "variant_3": {
        "minecraft:variant": {
          "value": 3
        }
      },
      "variant_4": {
        "minecraft:variant": {
          "value": 4
        }
      },
      "cc:stop_movement": {
        "minecraft:ageable": {
          "duration": 10,
          "grow_up": {
            "event": "cc:restore_movement_beam",
            "target": "self"
          }
        },
        "minecraft:movement": {
          "value": 0.0
        }
      },
      "cc:restore_movement": {
        "minecraft:movement": {
          "value": 0.03
        }
      },
      "cc:hit_timer": {
        "minecraft:timer": {
          "time": 0.5,
          "looping": false,
          "time_down_event": {
            "event": "cc:remove_hit",
            "target": "self"
          }
        }
      },
      "no_beacon": {
        "minecraft:is_baby": {}
      }
    },
    "events": {
      "on_crash": {
        "remove": {
          "component_groups": ["attack_components", "move_components"]
        },
        "add": {
          "component_groups": ["crashed"]
        },
        "set_property": {
          "cc_alien:crashed": true
        }
      },
      "on_beacon_summoned": {
        "set_property": {
          "cc_alien:beacon_summoned": true
        }
      },
      "on_damage_taken_player": {
        "sequence": [
          {
            "add": {
              "component_groups": ["cc:hit_timer"]
            }
          },
          {
            "set_property": {
              "cc_alien:has_taken_damage": true
            }
          }
        ]
      },
      "cc:stop_movement": {
        "add": {
          "component_groups": ["cc:stop_movement"]
        }
      },
      "cc:restore_movement": {
        "add": {
          "component_groups": ["cc:restore_movement"]
        }
      },
      "cc:restore_movement_beam": {
        "sequence": [
          {
            "add": {
              "component_groups": ["cc:restore_movement"]
            }
          },
          {
            "set_property": {
              "cc_alien:beam": false
            }
          }
        ]
      },
      "minecraft:entity_spawned": {
        "sequence": [
          {
            "add": {
              "component_groups": ["attack_components", "move_components"]
            }
          },
          {
            "randomize": [
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_0"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_1"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_2"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_3"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_4"]
                }
              }
            ]
          }
        ]
      },
      "cc:clear_beam": {
        "set_property": {
          "cc_alien:beam": false
        }
      },
      "cc:beam": {
        "set_property": {
          "cc_alien:beam": true
        }
      },
      "cc:remove_hit": {
        "sequence": [
          {
            "remove": {
              "component_groups": ["cc:hit_timer"]
            }
          },
          {
            "set_property": {
              "cc_alien:has_taken_damage": false
            }
          }
        ]
      },
      "no_beacon": {
        "sequence": [
          {
            "randomize": [
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_0"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_1"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_2"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_3"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_4"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_5"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_6"]
                }
              },
              {
                "weight": 1,
                "add": {
                  "component_groups": ["variant_7"]
                }
              }
            ]
          },
          {
            "add": {
              "component_groups": ["attack_components", "move_components"]
            }
          },
          {
            "add": {
              "component_groups": ["no_beacon"]
            }
          }
        ]
      }
    }
  }
}
