{
	"format_version": "1.19.40",
	"minecraft:entity": {
		"description": {
			"identifier": "dotvi:the_creator_puppet",
			"is_spawnable": false,
			"is_summonable": true,
			"is_experimental": false,
			"animations": {
				"finalroar": "controller.animation.puppet.finalroar",
				"scene": "animation.puppet.intro.scene"
			},
			"scripts": {
				"animate": [
					"finalroar",
					{
						"scene": "!query.is_sheared"
					}
				]
			}
		},
		"component_groups": {
			"dotvi:melee_mode_spawn": {
				"minecraft:attack": {
					"damage": 25
				},
				"minecraft:behavior.melee_attack": {
					"priority": 2,
					"speed_multiplier": 1,
					"track_target": false
				},
				"minecraft:behavior.hurt_by_target": {
					"priority": 1
				},
				"minecraft:timer": {
					"looping": true,
					"time": 1,
					"time_down_event": {
						"target": "self",
						"event": "dotvi:attack_shuffle",
						"filters": {
							"all_of": [
								{
									"test": "has_target",
									"subject": "self",
									"value": true
								}
							]
						}
					}
				},
				"minecraft:movement": {
					"value": 0.35
				},
				"minecraft:teleport": {
					"random_teleports": true,
					"max_random_teleport_time": 1,
					"min_random_teleport_time": 1,
					"random_teleport_cube": [
						5,
						2,
						5
					],
					"target_distance": 9,
					"target_teleport_chance": 0.08,
					"light_teleport_chance": 0.08
				},
				"minecraft:variant": {
					"value": 1
				}
			},
			"dotvi:ranged_mode": {
				"minecraft:behavior.ranged_attack": {
					"priority": 3,
					"burst_shots": 15,
					"burst_interval": 0.35,
					"charge_charged_trigger": 0,
					"charge_shoot_trigger": 2,
					"attack_interval_min": 1,
					"attack_interval_max": 3,
					"attack_radius": 32,
					"swing": true
				},
				"minecraft:shooter": {
					"def": "dotvi:dark_kunai",
					"aux_val": 19
				},
				"minecraft:timer": {
					"looping": true,
					"time": 4,
					"time_down_event": {
						"target": "self",
						"event": "dotvi:attack_shuffle",
						"filters": {
							"all_of": [
								{
									"test": "has_target",
									"subject": "self",
									"value": true
								}
							]
						}
					}
				},
				"minecraft:movement": {
					"value": 0.25
				},
				"minecraft:teleport": {
					"random_teleports": true,
					"max_random_teleport_time": 2,
					"min_random_teleport_time": 2,
					"random_teleport_cube": [
						5,
						5,
						5
					],
					"target_distance": 4,
					"target_teleport_chance": 0.05,
					"light_teleport_chance": 0.05
				},
				"minecraft:variant": {
					"value": 2
				},
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 2,
					"within_radius": 35,
					"reselect_targets": true,
					"entity_types": [
						{
							"filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "mob"
									},
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							}
						}
					],
					"must_see": true,
					"must_see_forget_duration": 17
				}
			},
			"dotvi:summon_mode": {
				"minecraft:behavior.summon_entity": {
					"priority": 0,
					"summon_choices": [
						{
							"min_activation_range": 0,
							"max_activation_range": 10,
							"cooldown_time": 1,
							"weight": 5,
							"cast_duration": 1,
							"particle_color": "#FFAFA8FF",
							"start_sound_event": "mob.thepuppet.cast",
							"sequence": [
								{
									"shape": "circle",
									"target": "self",
									"base_delay": 1,
									"delay_per_summon": 0.25,
									"num_entities_spawned": 3,
									"entity_type": "dotvi:alatarrune_puppetzappy",
									"size": 1.5,
									"sound_event": "prepare.attack"
								},
								{
									"shape": "circle",
									"target": "self",
									"base_delay": 0.15,
									"delay_per_summon": 0.25,
									"num_entities_spawned": 3,
									"entity_type": "dotvi:alatarrune_puppetzappy",
									"size": 4.5
								},
								{
									"shape": "circle",
									"target": "self",
									"base_delay": 0.15,
									"delay_per_summon": 0.25,
									"num_entities_spawned": 3,
									"entity_type": "dotvi:alatarrune_puppetzappy",
									"size": 7.5
								}
							]
						},
						{
							"weight": 1,
							"cooldown_time": 5,
							"cast_duration": 2,
							"particle_color": "#FFB3B3CC",
							"sequence": [
								{
									"shape": "circle",
									"target": "self",
									"base_delay": 2,
									"num_entities_spawned": 1,
									"entity_type": "dotvi:godslayer_alatar_puppetsupport",
									"summon_cap": 3,
									"summon_cap_radius": 16,
									"size": 1,
									"sound_event": "mob.thepuppet.cast"
								}
							]
						},
						{
							"min_activation_range": 0,
							"cooldown_time": 1,
							"weight": 2,
							"cast_duration": 2,
							"particle_color": "#FF023800",
							"start_sound_event": "cast.spell",
							"sequence": [
								{
									"shape": "circle",
									"target": "self",
									"base_delay": 1,
									"delay_per_summon": 0.2,
									"num_entities_spawned": 5,
									"size": 5.5,
									"sound_event": "prepare.attack",
									"entity_type": "dotvi:alatarrune_valkyrie",
									"entity_lifespan": 13
								}
							]
						}
					]
				},
				"minecraft:timer": {
					"looping": true,
					"time": 10,
					"time_down_event": {
						"target": "self",
						"event": "dotvi:attack_shuffle",
						"filters": {
							"all_of": [
								{
									"test": "has_target",
									"subject": "self",
									"value": true
								}
							]
						}
					}
				},
				"minecraft:movement": {
					"value": {}
				},
				"minecraft:variant": {
					"value": 3
				},
				"minecraft:behavior.avoid_mob_type": {
					"priority": 5,
					"entity_types": [
						{
							"filters": {
								"test": "is_family",
								"subject": "other",
								"value": "player"
							},
							"max_dist": 8,
							"walk_speed_multiplier": 0.6,
							"sprint_speed_multiplier": 1
						}
					]
				},
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 2,
					"within_radius": 35,
					"reselect_targets": true,
					"entity_types": [
						{
							"filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "mob"
									},
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							}
						}
					],
					"must_see": true,
					"must_see_forget_duration": 17
				}
			},
			"dotvi:spin_mode": {
				"minecraft:attack": {
					"damage": 35
				},
				"minecraft:behavior.melee_attack": {
					"priority": 2,
					"speed_multiplier": 1,
					"track_target": false
				},
				"minecraft:behavior.hurt_by_target": {
					"priority": 1
				},
				"minecraft:area_attack": {
					"damage_range": 2,
					"damage_per_tick": 25,
					"cause": "entity_attack"
				},
				"minecraft:damage_sensor": {
					"triggers": [
						{
							"cause": "all",
							"deals_damage": false
						}
					]
				},
				"minecraft:timer": {
					"looping": true,
					"time": 3,
					"time_down_event": {
						"target": "self",
						"event": "dotvi:attack_shuffle",
						"filters": {
							"all_of": [
								{
									"test": "has_target",
									"subject": "self",
									"value": true
								}
							]
						}
					}
				},
				"minecraft:movement": {
					"value": 0.4
				},
				"minecraft:is_charged": {},
				"minecraft:variant": {
					"value": 4
				},
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 2,
					"within_radius": 35,
					"reselect_targets": true,
					"entity_types": [
						{
							"filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "mob"
									},
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							}
						}
					],
					"must_see": true,
					"must_see_forget_duration": 17
				}
			},
			"dotvi:death_transform": {
				"minecraft:transformation": {
					"into": "dotvi:the_creator_puppet_defeat"
				}
			},
			"dotvi:melee_mode": {
				"minecraft:attack": {
					"damage": 25
				},
				"minecraft:behavior.melee_attack": {
					"priority": 2,
					"speed_multiplier": 1,
					"track_target": false
				},
				"minecraft:behavior.hurt_by_target": {
					"priority": 1
				},
				"minecraft:timer": {
					"looping": true,
					"time": 5,
					"time_down_event": {
						"target": "self",
						"event": "dotvi:attack_shuffle",
						"filters": {
							"all_of": [
								{
									"test": "has_target",
									"subject": "self",
									"value": true
								}
							]
						}
					}
				},
				"minecraft:movement": {
					"value": 0.4
				},
				"minecraft:teleport": {
					"random_teleports": true,
					"max_random_teleport_time": 1,
					"min_random_teleport_time": 1,
					"random_teleport_cube": [
						5,
						2,
						5
					],
					"target_distance": 9,
					"target_teleport_chance": 0.15,
					"light_teleport_chance": 0.15
				},
				"minecraft:variant": {
					"value": 1
				},
				"minecraft:behavior.nearest_attackable_target": {
					"priority": 2,
					"within_radius": 35,
					"reselect_targets": true,
					"entity_types": [
						{
							"filters": {
								"any_of": [
									{
										"test": "is_family",
										"subject": "other",
										"value": "mob"
									},
									{
										"test": "is_family",
										"subject": "other",
										"value": "player"
									}
								]
							}
						}
					],
					"must_see": true,
					"must_see_forget_duration": 17
				}
			},
			"dotvi:starting_cutscene": {
				"minecraft:behavior.nearest_attackable_target": {},
				"minecraft:timer": {
					"looping": false,
					"time": 8.5,
					"time_down_event": {
						"target": "self",
						"event": "dotvi:attack_shuffle"
					}
				},
				"minecraft:damage_sensor": {
					"triggers": {
						"cause": "all",
						"deals_damage": false
					}
				},
				"minecraft:movement": {
					"value": 0
				}
			},
			"dotvi:introlock": {
				"minecraft:is_sheared": {}
			}
		},
		"components": {
			"minecraft:behavior.nearest_attackable_target": {
				"priority": 2,
				"within_radius": 35,
				"reselect_targets": true,
				"entity_types": [
					{
						"filters": {
							"any_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "mob"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "player"
								}
							]
						}
					}
				],
				"must_see": true,
				"must_see_forget_duration": 17
			},
			"minecraft:behavior.hurt_by_target": {},
			"minecraft:behavior.random_stroll": {
				"priority": 5
			},
			"minecraft:behavior.look_at_player": {
				"priority": 5
			},
			"minecraft:behavior.random_look_around": {
				"priority": 6
			},
			"minecraft:movement.basic": {},
			"minecraft:navigation.walk": {
				"can_walk": true
			},
			"minecraft:jump.static": {},
			"minecraft:can_climb": {},
			"minecraft:behavior.float": {},
			"minecraft:timer": {
				"looping": true,
				"time": 10,
				"time_down_event": {
					"target": "self",
					"event": "dotvi:attack_shuffle",
					"filters": {
						"all_of": [
							{
								"test": "has_target",
								"subject": "self",
								"value": true
							}
						]
					}
				}
			},
			"minecraft:health": {
				"value": 2500
			},
			"minecraft:boss": {
				"hud_range": 20,
				"name": "Extorris-Poeta"
			},
			"minecraft:physics": {
				"has_collision": true,
				"has_gravity": true
			},
			"minecraft:movement": {
				"value": 0.25
			},
			"minecraft:damage_sensor": {},
			"minecraft:persistent": {},
			"minecraft:conditional_bandwidth_optimization": {},
			"minecraft:knockback_resistance": {
				"value": 50
			},
			"minecraft:on_death": {
				"event": "dotvi:transform_death_phase",
				"target": "self"
			},
			"minecraft:scale": {
				"value": 1.15
			},
			"minecraft:type_family": {
				"family": [
					"mob",
					"enderman",
					"monster",
					"creator"
				]
			}
		},
		"events": {
			"minecraft:entity_spawned": {
				"add": {
					"component_groups": [
						"dotvi:starting_cutscene"
					]
				}
			},
			"dotvi:attack_shuffle": {
				"sequence": [
					{
						"remove": {
							"component_groups": [
								"dotvi:melee_mode",
								"dotvi:ranged_mode",
								"dotvi:summon_mode",
								"dotvi:spin_mode",
								"dotvi:starting_cutscene"
							]
						},
						"add": {
							"component_groups": [
								"dotvi:introlock"
							]
						}
					},
					{
						"randomize": [
							{
								"weight": 3,
								"add": {
									"component_groups": [
										"dotvi:melee_mode"
									]
								},
								"run_command": {
									"command": [
										"particle dotvi:transition_melee ~~~"
									]
								}
							},
							{
								"weight": 2,
								"add": {
									"component_groups": [
										"dotvi:summon_mode"
									]
								},
								"run_command": {
									"command": [
										"particle dotvi:transition_magic ~~~"
									]
								}
							},
							{
								"weight": 2,
								"add": {
									"component_groups": [
										"dotvi:ranged_mode"
									]
								},
								"run_command": {
									"command": [
										"particle dotvi:transition_ranged ~~~"
									]
								},
								"filters": {
									"subject": "self",
									"test": "actor_health",
									"value": 500,
									"operator": ">"
								}
							},
							{
								"weight": 3,
								"add": {
									"component_groups": [
										"dotvi:spin_mode"
									]
								},
								"filters": {
									"subject": "self",
									"test": "actor_health",
									"value": 500,
									"operator": "<"
								},
								"run_command": {
									"command": [
										"playsound mob.thepuppet.spinattack @a[r=15] ~~~"
									]
								}
							}
						]
					}
				]
			},
			"dotvi:transform_death_phase": {
				"add": {
					"component_groups": [
						"dotvi:death_transform"
					]
				}
			},
			"dotvi:boss_theme_start": {
				"run_command": {
					"command": [
						"playsound mob.thepuppet.boss @a[r=20]"
					]
				}
			},
			"dotvi:boss_theme_stop": {
				"run_command": {
					"command": [
						"stopsound @a[r=20] mob.thepuppet.boss"
					]
				}
			}
		},
		"permutations": [
			{
				"condition": "query.health<500",
				"components": {
					"minecraft:mob_effect": {
						"effect_range": 20,
						"effect_time": 2,
						"mob_effect": "darkness",
						"entity_filter": {
							"all_of": [
								{
									"test": "is_family",
									"subject": "other",
									"value": "player"
								},
								{
									"test": "is_family",
									"subject": "other",
									"value": "inanimate",
									"operator": "not"
								}
							]
						}
					}
				}
			}
		]
	}
}