{
    "format_version": "1.10.0",
    "animation_controllers": {
		"controller.animation.mommy_chase": {
		    "initial_state": "default",
		    "states": {
		        "default": {
		            "transitions": [{
		                    "is_player": "query.has_target ? (query.target -> q.has_any_family('player')) : 0"
		                }
		            ]
		        },
		        "is_player": {
		            "on_entry": [
						"/music play mob.mommy_long_bd.chase 0.5 0 loop"
		            ],
					"on_exit": [
						"/music stop 2.5"
		            ],
					"transitions": [{
		                    "default": "return query.has_target ? !(query.target -> q.has_any_family('player')) : query.is_alive;"
		                }, {
		                    "is_dead": "!query.is_alive"
		                }
		            ]
		        },
				"is_dead": {
					"on_entry": [
						"/music stop 2.5"
		            ],
					"transitions": [{
		                    "default": "query.is_alive"
		                }
		            ]
		        }
		    }
		},
		"controller.animation.mommy_grab": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "attack1": "query.is_casting"
                        }
                    ]
				},
				"attack1": {
					"animations": ["eat_time"],
                    "transitions": [{
                            "default": "!query.is_casting"
                        }
                    ],
					"on_entry": [
						"/execute as @s at @s run effect @s weakness 1 255 true",
						"@s bd:time_to_eat",
						"@s bd:stop_jumpscare"
                    ]
                }
            }
        },
		"controller.animation.mommy_look": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "attack1": "query.target_x_rotation"
                        }
                    ]
				},
				"attack1": {
                    "transitions": [{
                            "default": "!query.target_x_rotation"
                        }
                    ],
					"on_entry": [
						"/say work",
						"/tag @a[m=!c,r=100,tag=!mommy_prey] add mommy_prey"
                    ],
					"on_exit": [
						"/say stop work",
						"/tag @a[tag=mommy_prey] remove mommy_prey"
                    ]
                }
            }
        },
		"controller.animation.mommy_ground_air": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "dusk2": "query.is_on_ground"
                        }
                    ]
				},
				"dusk2": {
                    "transitions": [{
                            "default": "!query.is_on_ground"
                        }
                    ],
					"on_entry": [
						"@s bd:ground"
                    ],
					"on_exit": [
						"@s bd:air"
                    ]
                }
            }
        },
		"controller.animation.mommy_climb_pro": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "dusk2": "query.variant == 4 || query.is_wall_climbing"
                        }
                    ]
				},
				"dusk2": {
					"animations": ["mommy_climb"],
                    "transitions": [{
                            "default": "!query.is_wall_climbing || query.all_animations_finished"
                        }
                    ],
					"on_entry": [
						"/execute as @s anchored feet if block ~~-1~ air unless block ~~2~ air unless block ^-0.5^^ air if block ^0.5^^ air run tp @s ^0.5^^ true",
						"/execute as @s anchored feet if block ~~-1~ air unless block ~~2~ air unless block ^0.5^^ air if block ^-0.5^^ air run tp @s ^-0.5^^ true",
						"/execute as @s anchored feet if block ~~-1~ air unless block ~~2~ air if block ^0.5^^ air if block ^-0.5^^ air run tp @s ^1^^ true",
						"/execute as @s anchored feet if block ~~-1~ air if block ~~2~ air run effect @s levitation 1 4 true"
                    ]
                }
            }
        },
		"controller.animation.mommy_cooldown": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "cast": "query.is_casting"
                        }
                    ],
					"on_entry": [
						"@s bd:use_jumpscare"
                    ]
				},
				"cast": {
					"animations": ["eat_cooldown_time"],
                    "transitions": [{
                            "on_cooldown": "query.all_animations_finished"
                        }
                    ],
					"on_entry": [
                    ]
                },
				"on_cooldown": {
					"animations": ["eat_skill_back"],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }
                    ],
					"on_entry": [
						"@s bd:stop_jumpscare"
                    ]
                }
            }
        },
		"controller.animation.mommy_grab_kill": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "attack1": "query.has_rider"
                        }
                    ]
				},
				"attack1": {
					"animations": ["mommy_eat2", "eat_time_kill2", "eat_look"],
                    "transitions": [{
                            "stop_attack1": "query.all_animations_finished"
                        }
                    ]
                },
				"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"
                    ],
					"on_exit": [
						"@s bd:no_allow_jumpscare"
						
                    ]
                }
            }
        },
		"controller.animation.mommy_self_control": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "get_off": "query.target_x_rotation"
                        }
                    ]
				},
				"get_off": {
                    "transitions": [{
                            "default": "!query.target_x_rotation"
                        }, {
                            "get_off2": "query.target_x_rotation"
                        }
                    ],
					"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.target_x_rotation"
                        }, {
                            "get_off": "query.target_x_rotation"
                        }
                    ],
					"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.mommy_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": ["mommy_calm"],
                    "transitions": [{
                            "default": "query.has_target || query.is_stunned"
                        }
                    ]
                }
            }
        },
		"controller.animation.mommy_fake_dead": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "faking": "query.is_playing_dead"
                        }
                    ]
				},
				"faking": {
					"animations": ["mommy_fake_dead_heal"],
                    "transitions": [{
                            "get_up": "query.health >= 500"
                        }
                    ],
					"on_entry": [
						"/effect @s slowness 2900 255 true",
						"@s bd:is_faking_dead"
                    ]
                },
				"get_up": {
                    "transitions": [{
                            "default": "!query.is_stunned"
                        }
                    ],
					"on_entry": [
						"@s bd:stop_fake_dead",
						"/effect @s slowness 0 0 true",
						"/effect @s slowness 3 255 true"
                    ]
                }
            }
        },
		"controller.animation.mommy_attacks": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "attack1": "query.mark_variant == 1 && !query.is_casting "
                        }, {
                            "attack2": "query.mark_variant == 2 && !query.is_casting"
                        }, {
                            "attack3": "query.mark_variant == 3 && !query.is_casting"
                        }, {
                            "attack4": "query.mark_variant == 6 && !query.is_casting"
                        }, {
                            "jump_back": "query.mark_variant == 4 && !query.is_casting"
                        }, {
                            "ram_attack": "query.mark_variant == 5 && !query.is_casting"
                        }, {
                            "jump_forward": "query.mark_variant == 7 && !query.is_casting"
                        }, 
						
						{
                            "is_faking": "query.is_stunned"
                        }
                    ],
					"on_entry": [
						"/tag @s remove jump_back",
						"/tag @s remove attack1",
						"/tag @s remove attack3",
						"/tag @s remove move_back",
						"/tag @s remove ram_attack",
						"/tag @s remove attack4",
						"/tag @s remove jump_forward",
						"/tag @s remove jump_forward_run",
						"@s bd:use_melee_control"
                    ]
				},
				"is_faking": {
					"transitions": [{
                            "default": "!query.is_stunned"
                        }
                    ],
					"on_entry": [
						"/tag @s remove jump_back",
						"/tag @s remove attack1",
						"/tag @s remove attack3",
						"/tag @s remove move_back",
						"/tag @s remove ram_attack",
						"/tag @s remove attack4",
						"/tag @s remove jump_forward",
						"/tag @s remove jump_forward_run",
						"@s bd:is_faking_dead"
                    ]
				},
				"default2": {
					"transitions": [{
                            "default": "!query.has_rider"
                        }
                    ]
				},
				"attack1": {
					"animations": [
                        "mommy_attack1"
                    ],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }, {
                            "default2": "query.has_rider"
                        }, {
                            "is_faking": "query.is_stunned"
                        }
                    ],
                    "on_exit": [
						"@s bd:use_melee_control"
                    ]
                },
				"attack2": {
					"animations": [
                        "mommy_attack2"
                    ],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }, {
                            "default2": "query.has_rider"
                        }, {
                            "is_faking": "query.is_stunned"
                        }
                    ],
                    "on_exit": [
						"@s bd:use_melee_control"
                    ]
                },
				"attack3": {
					"animations": [
                        "mommy_attack3"
                    ],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }, {
                            "default2": "query.has_rider"
                        }, {
                            "is_faking": "query.is_stunned"
                        }
                    ],
					"on_exit": [
						"@s bd:use_melee_control"
                    ]
                },
				"attack4": {
					"animations": [
                        "mommy_attack4"
                    ],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }, {
                            "default2": "query.has_rider"
                        }, {
                            "is_faking": "query.is_stunned"
                        }
                    ],
					"on_exit": [
						"@s bd:use_melee_control"
                    ]
                },
				"jump_back": {
					"animations": [
                        "mommy_jump_back"
                    ],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }, {
                            "default2": "query.has_rider"
                        }, {
                            "is_faking": "query.is_stunned"
                        }
                    ],
					"on_exit": [
						"@s bd:use_melee_control",
						"/tag @s remove jump_back"
                    ]
                },
				"jump_forward": {
					"animations": [
                        "mommy_jump_forward"
                    ],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }, {
                            "default2": "query.has_rider"
                        }, {
                            "is_faking": "query.is_stunned"
                        }
                    ],
					"on_exit": [
						"@s bd:use_melee_control",
						"/tag @s remove jump_forward"
                    ]
                },
				"ram_attack": {
					"animations": [
                        "mommy_ram_attack", "mommy_ram_damage"
                    ],
                    "transitions": [{
                            "default": "query.all_animations_finished"
                        }, {
                            "default2": "query.has_rider"
                        }, {
                            "is_faking": "query.is_stunned"
                        }
                    ],
					"on_exit": [
						"@s bd:use_melee_control",
						"/tag @s remove ram_attack"
                    ]
                }
            }
        },
		"controller.animation.mommy_use_hand": {
		    "initial_state": "default",
		    "states": {
		        "default": {
		            "transitions": [{
		                    "is_using_hand": "query.skin_id == 1"
		                }
		            ],
					"on_entry": [
						"/tag @s[tag=is_use_hand] remove is_use_hand"
		            ]
		        },
		        "is_using_hand": {
		            "animations": ["is_stretching", "mommy_time_hand_back"],
					"transitions": [{
		                    "default": "query.skin_id != 1"
		                }, {
		                    "default2": "query.all_animations_finished"
		                }
		            ],
					"on_entry": [
						"/execute as @s at @s run summon bd:mommy_hand_bd ~~1.5~",
						"/tag @s[tag=!is_use_hand] add is_use_hand"
		            ],
					"on_exit": [
						"/tag @s[tag=is_use_hand] remove is_use_hand"
		            ]
		        },
				"default2": {
		            "transitions": [{
		                    "default": "query.skin_id != 1"
		                }
		            ],
					"on_entry": [
						"@s bd:stop_hand_skill"
		            ]
		        }
		    }
		},
		"controller.animation.mommy_use_hand_skill": {
			"initial_state": "default",
			"states": {
				"default": {
					"on_entry": [
                        "variable.random_attack = math.round(math.random(0,1));"
                    ],
					"transitions": [
						{
							"stretch1": "query.has_target && variable.random_attack == 0"
						},
						{
							"stretch2": "query.has_target && variable.random_attack == 1"
						}
					]
				},
				"stretch1": {
					"animations": ["use_hand_stretch1"],
					"transitions": [
						{
							"stretch1_run": "query.all_animations_finished"
						},
						{
							"default": "query.is_casting || query.mark_variant != 0 || !query.has_target"
						}
					]
				},
				"stretch1_run": {
					"transitions": [
						{
							"default": "query.skin_id != 1"
						}
					]
				},
				"stretch2": {
					"animations": ["use_hand_stretch2"],
					"transitions": [
						{
							"stretch2_run": "query.all_animations_finished"
						},
						{
							"default": "query.is_casting || query.mark_variant != 0 || !query.has_target"
						}
					]
				},
				"stretch2_run": {
					"transitions": [
						{
							"default": "query.skin_id != 1"
						}
					]
				}
			}
		},
		
		"controller.animation.undespawn_con": {
			"initial_state": "default",
			"states": {
				"default": {
					"animations": ["undespawn"],
					"transitions": [
						{
							"detected": "v.x > 0"
						}
					]
				},
				"detected": {
					"animations": ["undespawn"],
					"transitions": [
						{
							"default": "v.x > 0"
						}
					],
					"on_entry": [
						"@s bd:undespawning"
					]
				}
			}
		},
		"controller.animation.tail_hand_detect_con": {
			"initial_state": "default",
			"states": {
				"default": {
					"animations": ["tail_hand_detect"],
					"transitions": [
						{
							"detected": "v.x > 0"
						}
					]
				},
				"detected": {
					"animations": ["tail_hand_detect"],
					"transitions": [
						{
							"default": "v.x > 0"
						}
					],
					"on_entry": [
						"@s bd:undespawning"
					]
				}
			}
		},
		"controller.animation.hand_tail_aim_con": {           //hand_con
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "move": "query.is_alive" //query.ground_speed >= 0.1
                        }
                    ]
				},
				"move": {
					"animations": ["hand_tail_aim", "hand_tail_move"],
                    "transitions": [{
                            "default": "!query.is_alive"
                        }
                    ]
                }
            }
        },
		"controller.animation.hand_tail_tar_con": {           //hand_tar_con
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "reached": "query.variant == 0"
                        }
                    ]
				},
				"reached": {
					"animations": ["hand_catch"],
                    "transitions": [{
                            "default": "query.variant == 1"
                        }
                    ]
                }
            }
        },
		"controller.animation.mommy_celling_camp": {
			"initial_state": "default",
            "states": {
                "default": {
					"on_entry": [
                        "variable.random_camp = math.round(math.random_integer(0,2));"
                    ],
					"transitions": [{
                            "camp1": "variable.random_camp == 0"
                        }, {
                            "camp2": "variable.random_camp == 1"
                        }, {
                            "camp3": "variable.random_camp == 2"
                        }
                    ]
				},
				"camp1": {
					"animations": ["celling_camp1"],
                    "transitions": [{
                            "default": "query.all_animations_finished || query.is_saddled"
                        }
                    ]
                },
				"camp2": {
					"animations": ["celling_camp2"],
                    "transitions": [{
                            "default": "query.all_animations_finished || query.is_saddled"
                        }
                    ]
                },
				"camp3": {
					"animations": ["celling_camp3"],
                    "transitions": [{
                            "default": "query.all_animations_finished || query.is_saddled"
                        }
                    ]
                }
            }
        },
		"controller.animation.hand_tail_ride": {
			"initial_state": "default",
            "states": {
                "default": {
					"transitions": [{
                            "get_ride": "!query.has_rider"
                        }
                    ]
				},
				"get_ride": {
					"animations": ["hand_tail_despawn"],
                    "transitions": [{
                            "default": "!query.has_rider"
                        }
                    ]
                }
            }
        }
    }
}