{
    "format_version": "1.10.0",
    "animation_controllers": {
        "controller.animation.mini_huggy_wuggy_hug": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "attack1": "query.is_casting"
                        }
                    ]
				},
				"attack1": {
					"animations": ["mini_hug_time"],
                    "transitions": [{
                            "default": "!query.is_casting"
                        }
                    ],
					"on_entry": [
						"@s bd:time_to_hug"
                    ]
                }
            }
        },
		"controller.animation.mini_huggy_cooldown": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "cast": "query.is_casting"
                        }
                    ],
					"on_entry": [
						"@s bd:use_jumpscare"
                    ]
				},
				"cast": {
					"animations": ["mini_hug_cooldown_time"],
                    "transitions": [{
                            "on_cooldown": "query.all_animations_finished"
                        }
                    ],
					"on_entry": [
                    ]
                },
				"on_cooldown": {
					"animations": ["mini_hug_skill_back"],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }
                    ],
					"on_entry": [
						"@s bd:stop_jumpscare"
                    ]
                }
            }
        },
		"controller.animation.mini_hug_self_control": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "get_off": "query.has_target"
                        }
                    ]
				},
				"get_off": {
                    "transitions": [{
                            "default": "!query.has_target"
                        }, {
                            "get_off2": "query.has_target"
                        }
                    ],
					"on_entry": [
						"/ride @s stop_riding",
						"/execute as @s at @s run kill @e[type=boat,r=1,c=1]"
                    ],
					"on_exit": [
						"/ride @s stop_riding",
						"/execute as @s at @s run kill @e[type=boat,r=1,c=1]"
                    ]
                },
				"get_off2": {
                    "transitions": [{
                            "default": "!query.has_target"
                        }, {
                            "get_off": "query.has_target"
                        }
                    ],
					"on_entry": [
						"/ride @s stop_riding",
						"/execute as @s at @s run kill @e[type=boat,r=1,c=1]"
                    ],
					"on_exit": [
						"/ride @s stop_riding",
						"/execute as @s at @s run kill @e[type=boat,r=1,c=1]"
                    ]
                }
            }
        },
		"controller.animation.mini_huggy_hunt_time": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "hunt_mode": "query.has_target"
                        }, {
                            "passive_mode": "!query.has_target"
                        }
                    ]
				},
				"hunt_mode": {
                    "transitions": [{
                            "passive_mode": "!query.has_target"
                        }
                    ],
					"on_entry": [
						"@s bd:hunt_mode",
						"/effect @s regeneration 0 0"
                    ]
                },
				"passive_mode": {
					"animations": ["mini_huggy_calm"],
                    "transitions": [{
                            "default": "query.has_target"
                        }
                    ]
                }
            }
        },
		"controller.animation.mini_huggy_wuggy_hug_kill": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "attack1": "query.has_rider && query.variant == 0"
                        }, {
                            "attack2": "query.has_rider && query.variant == 1"
                        }
                    ]
				},
				"attack1": {
					"animations": ["mini_huggy_hug2", "mini_hug_time_kill2"],
                    "transitions": [{
                            "stop_attack1": "query.all_animations_finished"
                        }
                    ],
					"on_entry": [
						"/ride @s summon_rider bd:mini_huggy_hug"
                    ]
                },
				"stop_attack1": {
                    "transitions": [{
                            "default": "!query.has_rider || !query.has_target"
                        }
                    ],
					"on_entry": [
						"/execute as @s at @s run ride @a[r=5,c=1] stop_riding",
						"/execute as @s at @s run effect @s weakness 0 0 true"
                    ]
                },
				"attack2": {
					"animations": ["mini_huggy_hug2", "mini_hug_time_kill2", "mini_hug_look_down"],
                    "transitions": [{
                            "stop_attack2": "query.all_animations_finished"
                        }
                    ],
					"on_entry": [
						"/ride @s summon_rider bd:mini_huggy_hug2"
                    ]
                },
				"stop_attack2": {
                    "transitions": [{
                            "default": "!query.has_rider || !query.has_target"
                        }
                    ],
					"on_entry": [
						"/execute as @s at @s run ride @a[r=5,c=1] stop_riding",
						"/execute as @s at @s run effect @s weakness 0 0 true"
                    ]
                }
            }
        },
		"controller.animation.mini_huggy_wuggy_speed": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "in_vent": "query.variant == 1"
                        }
                    ]
				},
				"in_vent": {
					"animations": ["mini_huggy_speed"],
                    "transitions": [{
                            "default": "query.variant != 1"
                        }
                    ],
					"on_exit": [
						"/execute as @s at @s run effect @s slowness 0 0 true"
                    ]
                }
            }
        },
		"controller.animation.mini_huggy_wuggy_fall": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "fall": "(!query.is_interested && !query.is_delayed_attacking && !query.is_on_ground && query.ground_speed > 16)"
                        }
                    ],
					"on_entry": [
						"@s bd:enable_knock_resistance",
						"@s bd:not_in_fall"
		            ]
				},
				"fall": {
                    "transitions": [{
                            "land": "query.is_on_ground && (query.ground_speed < 16)"
                        }
                    ],
					"on_entry": [
						"@s bd:stop_knock_resistance",
						"@s bd:in_fall"
		            ]
                },
				"land": {
					"animations": ["mini_huggy_knock_time", "mini_huggy_knock_time2"],
                    "transitions": [{
                            "fall2": "!query.is_on_ground && (query.ground_speed > 16) && query.any_animation_finished"
                        }, {
                            "default": "query.is_on_ground && query.all_animations_finished"
                        }
                    ],
					"on_entry": [
						"/effect @s slowness 4 100 true",
						"@s bd:knock_when_hit",
						"/playanimation @s animation.mini_huggy_wuggy_bd.land_sound bd 1"
		            ]
                },
				"fall2": {
					"animations": ["mini_huggy_knock_time2"],
					"transitions": [{
                            "land": "query.is_on_ground && (query.ground_speed < 16)"
                        }, {
                            "default": "query.all_animations_finished"
                        }
                    ]
				}
            }
        },
		"controller.animation.mini_huggy_chase_speed": {
		    "initial_state": "default",
		    "states": {
		        "default": {
					"on_entry": [
                        "variable.random_speed = math.round(math.random(0,3));"
                    ],
		            "transitions": [{
		                    "is_mob": "query.has_target ? (query.target -> q.ground_speed >= 7) : 0"
		                }, {
		                    "is_player": "(query.has_target && variable.random_speed == 0) ? (query.target -> (q.is_sprinting && !query.is_on_ground)) : 0"
		                }, {
		                    "is_player2": "(query.has_target && variable.random_speed == 1) ? (query.target -> (q.is_sprinting && !query.is_on_ground)) : 0"
		                }, {
		                    "is_player3": "(query.has_target && variable.random_speed == 2) ? (query.target -> (q.is_sprinting && !query.is_on_ground)) : 0"
		                }, {
		                    "is_player4": "(query.has_target && variable.random_speed == 3) ? (query.target -> (q.is_sprinting && !query.is_on_ground)) : 0"
		                }, {
		                    "player_low_health": "query.has_target ? (query.target -> query.health <= 5) : 0"
		                }
		            ]
		        },
		        "is_mob": {
		            "on_entry": [
						"/effect @s speed 60 1 true"
		            ],
					"on_exit": [
						"/effect @s speed 0 0 true"
		            ],
					"transitions": [{
		                    "default": "return query.has_target ? (query.target -> q.ground_speed < 1) : 0;"
		                }, {
		                    "player_low_health": "query.has_target ? (query.target -> query.health <= 5) : 0"
		                }
		            ]
		        },
				"is_player": {
		            "on_entry": [
						"/effect @s speed 1 1 true"
		            ],
					"transitions": [{
		                    "default": "return query.has_target ? !(query.target -> (q.is_sprinting && !query.is_on_ground)) : 0;"
		                }, {
		                    "player_low_health": "query.has_target ? (query.target -> query.health <= 5) : 0"
		                }
		            ]
		        },
				"is_player2": {
		            "on_entry": [
						"/effect @s speed 1 2 true"
		            ],
					"transitions": [{
		                    "default": "return query.has_target ? !(query.target -> (q.is_sprinting && !query.is_on_ground)) : 0;"
		                }, {
		                    "player_low_health": "query.has_target ? (query.target -> query.health <= 5) : 0"
		                }
		            ]
		        },
				"is_player3": {
		            "on_entry": [
						"/effect @s speed 1 3 true"
		            ],
					"transitions": [{
		                    "default": "return query.has_target ? !(query.target -> (q.is_sprinting && !query.is_on_ground)) : 0;"
		                }, {
		                    "player_low_health": "query.has_target ? (query.target -> query.health <= 5) : 0"
		                }
		            ]
		        },
				"is_player4": {
		            "on_entry": [
						"/effect @s speed 0 0 true"
		            ],
					"transitions": [{
		                    "default": "return query.has_target ? !(query.target -> (q.is_sprinting && !query.is_on_ground)) : 0;"
		                }, {
		                    "player_low_health": "query.has_target ? (query.target -> query.health <= 5) : 0"
		                }
		            ]
		        },
				"player_low_health": {
					"animations": ["mini_huggy_speed2"],
		            "on_entry": [
						"/effect @s speed 100 2 true"
		            ],
					"on_exit": [
						"/effect @s speed 0 0 true"
		            ],
					"transitions": [{
		                    "default": "return query.has_target ? (query.target -> query.health >= 10) : query.is_alive;"
		                }
		            ]
		        }
		    }
		}
    }
}