{
	"format_version": "1.16.100",
	"minecraft:entity": {
		"description": {
			"identifier": "cc_fairytales:cerberus",
			"is_spawnable": true,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"cerberus": "controller.animation.cc_fairytales.lightning"
			},
			"scripts": {
				"animate": ["cerberus"]
			}
		},
		"component_groups": {
			"amigo": {
				"minecraft:type_family": {
					"family": ["cerberus"]
				},
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 3,
					"entity_types": [
						{
							"filters": {
								"all_of": [
									{
										"test": "is_family",
										"subject": "other",
										"operator": "==",
										"value": "monster"
									},
									{
										"test": "is_family",
										"subject": "other",
										"operator": "!=",
										"value": "player"
									},
									{
										"test": "is_family",
										"subject": "other",
										"operator": "!=",
										"value": "wolf"
									}
								]
							},
							"max_dist": 200
						}
					],
					"must_see": true
				},
				"minecraft:attack": {
					"damage": 10
				},
				"minecraft:behavior.melee_box_attack": {
					"priority": 4,
					"track_target": true,
					"cooldown_time": 1
				},
				"minecraft:timer": {
					"time": 20,
					"looping": true,
					"time_down_event": {
						"event": "desaparecer",
						"target": "self"
					}
				}
			},
			"ataque1": {
				"minecraft:attack": {
					"damage": 10
				},
				"minecraft:behavior.melee_box_attack": {
					"priority": 4,
					"track_target": true,
					"cooldown_time": 1
				}
			},
			"sin_rasho": {
				"minecraft:mark_variant": {
					"value": 0
				},
				"minecraft:timer": {
					"time": 1,
					"looping": true,
					"time_down_event": {
						"event": "volve",
						"target": "self"
					}
				}
			},
			"mas_rayos": {
				"minecraft:mark_variant": {
					"value": 1
				},
				"minecraft:timer": {
					"time": 1,
					"looping": true,
					"time_down_event": {
						"event": "andate",
						"target": "self"
					}
				}
			},
			"conta_tiempo": {
				"minecraft:mark_variant": {
					"value": 0
				},
				"minecraft:timer": {
					"time": 15,
					"looping": true,
					"time_down_event": {
						"event": "volve2",
						"target": "self"
					}
				}
			},
			"bolas_fuego": {
				"minecraft:environment_sensor": {
					"triggers": [
						{
							"event": "fase2",
							"filters": {
								"all_of": [
									{
										"test": "actor_health",
										"subject": "self",
										"value": 100,
										"operator": "<="
									}
								]
							}
						}
					]
				}
			},
			"tira_bola": {
				"minecraft:target_nearby_sensor": {
					"inside_range": 9.9,
					"outside_range": 10.0,
					"must_see": true,
					"on_inside_range": {
						"event": "switch_to_melee",
						"target": "self"
					},
					"on_outside_range": {
						"event": "switch_to_ranged",
						"target": "self"
					}
				}
			},
			"ataque_distancia": {
				"minecraft:shooter": {
					"def": "cc_fairytales:cerberus_ball"
				},
				"minecraft:behavior.ranged_attack": {
					"priority": 0,
					"burst_shots": 5,
					"burst_interval": 0.1,
					"attack_interval_min": 1.0,
					"attack_interval_max": 3.0,
					"attack_radius": 15.0
				}
			},
			"ataque_cercano": {
				"minecraft:behavior.melee_box_attack": {
					"priority": 2,
					"track_target": true,
					"cooldown_time": 2
				},
				"minecraft:attack": {
					"damage": 10,
					"effect_name": "wither",
					"effect_duration": 5
				}
			},
			"jefe": {
				"minecraft:boss": {
					"hud_range": 55,
					"name": "CERBERUS",
					"should_darken_sky": false
				},
				"minecraft:behavior.hurt_by_target": {
					"priority": 1
				},
				"minecraft:experience_reward": {
					"on_death": "100"
				},
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 2,
					"reselect_targets": true,
					"scan_interval": 10,
					"within_radius": 64.0,
					"must_see": false,
					"must_see_forget_duration": 0.5,
					"target_search_height": 80.0,
					"entity_types": [
						{
							"filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									},
									{
										"test": "is_family",
										"subject": "other",
										"value": "wolf"
									},
									{
										"test": "is_family",
										"subject": "other",
										"value": "cerberus2"
									},
									{
										"test": "is_family",
										"subject": "other",
										"value": "iron_golem"
									}
								]
							},
							"max_dist": 60
						}
					]
				},
				"minecraft:loot": {
					"table": "loot_tables/chillcraft/fairy/entities/cerberus.json"
				}
			},
			"me_voy": {
				"minecraft:instant_despawn": {
					"remove_child_entities": true
				}
			}
		},
		"components": {
			"minecraft:physics": {
				"has_gravity": true,
				"has_collision": true
			},
			"minecraft:type_family": {
				"family": ["cerberus", "monster"]
			},
			"minecraft:experience_reward": {
				"on_death": "100"
			},
			"minecraft:pushable": {
				"is_pushable": true
			},
			"minecraft:knockback_resistance": {
				"value": 0.9
			},
			"minecraft:fire_immune": {},
			"minecraft:follow_range": {
				"value": 64
			},
			"minecraft:damage_sensor": {
				"triggers": [
					{
						"cause": "lightning",
						"deals_damage": false
					}
				]
			},
			"minecraft:movement.basic": {},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:health": {
				"value": 200
			},
			"minecraft:nameable": {},
			"minecraft:behavior.float": {
				"priority": 0
			},
			"minecraft:navigation.walk": {},
			"minecraft:movement": {
				"value": 0.35
			},
			"minecraft:collision_box": {
				"width": 1.7,
				"height": 2.2
			},
			"minecraft:custom_hit_test": {
				"hitboxes": [
					{
						"width": 1.7,
						"height": 2.2,
						"pivot": [0, 1.1, 0]
					},
					{
						"width": 1.7,
						"height": 1.5,
						"pivot": [0, 2.15, 1.7]
					},
					{
						"width": 1.7,
						"height": 1.5,
						"pivot": [-1, 2.15, 1.7]
					},
					{
						"width": 1.7,
						"height": 1.5,
						"pivot": [1, 2.15, 1.7]
					},
					{
						"width": 2.2,
						"height": 1.3,
						"pivot": [0, 1.65, -2.3]
					}
				]
			},
			"minecraft:behavior.random_stroll": {
				"priority": 6,
				"speed_multiplier": 1
			},
			"minecraft:behavior.look_at_player": {
				"priority": 7,
				"look_distance": 8
			},
			"minecraft:behavior.random_look_around": {
				"priority": 8
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"sequence": [
					{
						"add": {
							"component_groups": [
								"sin_rasho",
								"bolas_fuego",
								"ataque1",
								"jefe"
							]
						}
					},
					{
						"queue_command": {
							"command": [
								"structure load fairy_tales:cc_fairy_coli ~-17 ~ ~-17"
							]
						}
					}
				]
			},
			"friends": {
				"add": {
					"component_groups": ["amigo"]
				}
			},
			"andate": {
				"remove": {
					"component_groups": ["mas_rayos"]
				},
				"add": {
					"component_groups": ["conta_tiempo"]
				}
			},
			"volve": {
				"remove": {
					"component_groups": ["sin_rasho"]
				},
				"add": {
					"component_groups": ["mas_rayos"]
				}
			},
			"volve2": {
				"remove": {
					"component_groups": ["conta_tiempo"]
				},
				"add": {
					"component_groups": ["mas_rayos"]
				}
			},
			"fase2": {
				"remove": {
					"component_groups": ["ataque1", "bolas_fuego"]
				},
				"add": {
					"component_groups": ["tira_bola"]
				}
			},
			"switch_to_melee": {
				"remove": {
					"component_groups": ["ataque_distancia"]
				},
				"add": {
					"component_groups": ["ataque_cercano"]
				}
			},
			"switch_to_ranged": {
				"remove": {
					"component_groups": ["ataque_cercano"]
				},
				"add": {
					"component_groups": ["ataque_distancia"]
				}
			},
			"desaparecer": {
				"add": {
					"component_groups": ["me_voy"]
				}
			}
		}
	}
}
