
{
    "format_version": "1.18.20",
    "minecraft:entity": {
        "description": {
            "identifier": "minecraft:player",
            "is_spawnable": true,
            "is_summonable": true,
            "is_experimental": false,
            "scripts": {
                "animate": [
					"huggy_wuggy_player.mood",
					"huggy_wuggy_player.fall",
					"huggy_wuggy_player.sprint",
					"huggy_wuggy_player.hug_kill",
					"huggy_wuggy_player.statue_form",
					{"hug_duck_other": "query.skin_id == 1"}
                ]
            },
            "animations": {
				"huggy_wuggy_player.mood": "controller.animation.huggy_wuggy_player.mood",
				"huggy_wuggy_player.fall": "controller.animation.huggy_wuggy_player.fall",
				"huggy_wuggy_player.sprint": "controller.animation.huggy_wuggy_player.sprint",
				"huggy_wuggy_player.hug_kill": "controller.animation.huggy_wuggy_player.hug_kill",
				"huggy_wuggy_player.statue_form": "controller.animation.huggy_wuggy_player.statue_form",
				"hug_duck_other": "animation.huggy_duck_other",
				"huggy_player_sprint": "animation.huggy_player_sprint",
				"huggy_player_time_land": "animation.huggy_player_time_land",
				"huggy_statue_time": "animation.huggy_statue_time",
				"huggy_player_time_stay": "animation.huggy_player_time_stay",
				"huggy_player_hug2": "animation.huggy_player_hug2",
				"hug_player_time_kill2": "animation.hug_player_time_kill2",
				"hug_player_look": "animation.hug_player_look",
				"hug_player_look_down": "animation.hug_player_look_down",
				"hug_player_regen_hung": "animation.hug_player_regen_hung",
				"hug_player_tired": "animation.hug_player_tired",
				"hug_player_wait_time": "animation.hug_player_wait_time",
				"huggy_player_time_air": "animation.huggy_player_time_air",
				"huggy_player_calm": "animation.huggy_player_calm",
				"huggy_player_calm_heal": "animation.huggy_player_calm_heal",
				"huggy_player_hunt": "animation.huggy_player_hunt"
            }
        },
        "component_groups": {
			"ban": {
				"minecraft:despawn": {}
			},
            "normal": {
				"minecraft:type_family": {
					"family": ["player"]
				},
                "minecraft:skin_id": {
                    "value": 0
                },
				"minecraft:health": {
					"value": 20,
					"max": 20
				},
                "minecraft:movement": {
                    "value": 0.1
                },
                "minecraft:attack": {
                    "damage": 1
                },
				"minecraft:collision_box": {
					"width": 0.6,
					"height": 1.8
				},
				"minecraft:nameable": {
					"always_show": true,
					"allow_name_tag_renaming": false
				}
            },
			"as_huggy": {
				"minecraft:nameable": {
					"always_show": false,
					"allow_name_tag_renaming": false
				},
                "minecraft:attack": {
					"damage": [ 10, 15 ]
				},
				"minecraft:health": {
					"value": 100,
					"max": 100
				},
                "minecraft:movement": {
                    "value": 0.08
                },
				"minecraft:skin_id": {
                    "value": 1
                },
				"minecraft:collision_box": {
					"width": 0.6,
					"height": 1.9
				},
				"minecraft:damage_sensor": {
					"triggers": [
						{
							"cause": "attack",
							"deals_damage": true,
							"damage_modifier": -7
						},
						{
							"cause": "contact",
							"deals_damage": true,
							"damage_modifier": -7
						},
						{
							"cause": "fall",
							"deals_damage": true,
							"damage_modifier": -10
						},
						{
							"cause": "anvil",
							"deals_damage": true,
							"damage_modifier": 15
						},
						{
							"cause": "magic",
							"deals_damage": true,
							"damage_modifier": -100
						},
						{
							"cause": "block_explosion",
							"deals_damage": true,
							"damage_modifier": 40
						},
						{
							"cause": "entity_explosion",
							"deals_damage": true,
							"damage_modifier": 20
						}
					]
				}
            },
			"huggy_catch": {
				"minecraft:is_charged": {},
				"minecraft:timer": {
                    "time": 0.4,
                    "looping": true,
                    "time_down_event": {
                        "event": "bd:huggy_hug"
                    }
                }
			},
			"huggy_hug": {
				"minecraft:timer": {
                    "time": 3,
                    "looping": true,
                    "time_down_event": {
                        "event": "bd:stop_hug"
                    }
                }
			},
			"huggy_calm": {
				"minecraft:mark_variant": {
					"value": 0
				}
			},
			"huggy_hunt": {
				"minecraft:mark_variant": {
					"value": 1
				}
			},
			"huggy_statue_form": {
				"minecraft:is_stunned": {
				},
				"minecraft:type_family": {
					"family": ["inanimate"]
				}
			},
			"huggy_not_statue": {
				"minecraft:type_family": {
					"family": ["huggy_wuggy_bd", "monster"]
				}
			},
			"jumpscare_vent": {
				"minecraft:rideable": {
					"seat_count": 2,
					"interact_text": "action.interact.ride.bd:huggy_wuggy_player.bd",
						"family_types": [
							"huggy_hug", "player"
						],
						"seats": [
						{
							"position": [0, -2.2, 1.2],
							"rotate_rider_by": 180,
							"lock_rider_rotation": 0
						},
						{
							"position": [0, -2.2, 1.2],
							"rotate_rider_by": 180,
							"lock_rider_rotation": 0
						}
					]
				},
				"minecraft:variant": {
					"value": 1
				},
				"minecraft:collision_box": {
					"width": 0.6,
					"height": 1.8
				},
				"minecraft:custom_hit_test": {
					"hitboxes": [
						{
							"width": 1,
							"height": 1.8,
							"pivot": [0, 2, 0]
						}
					]
				},
				"minecraft:is_sheared": {
				}
			},
			"jumpscare_novent": {
				"minecraft:rideable": {
					"seat_count": 2,
					"interact_text": "action.interact.ride.bd:huggy_wuggy_player.bd",
						"family_types": [
							"huggy_hug", "player"
						],
						"seats": [
						{
							"position": [0, 0.6, 1.4],
							"rotate_rider_by": 180,
							"lock_rider_rotation": 0
						},
						{
							"position": [0, 0.6, 1.4],
							"rotate_rider_by": 180,
							"lock_rider_rotation": 0
						}
					]
				},
				"minecraft:variant": {
					"value": 0
				},
				"minecraft:collision_box": {
					"width": 0.6,
					"height": 1.9
				},
				"minecraft:custom_hit_test": {
					"hitboxes": [
						{
							"width": 1,
							"height": 4,
							"pivot": [0, 2, 0]
						}
					]
				}
			}
        },
        "components": {
             "minecraft:type_family": {
                "family": ["player"]
            },
            "minecraft:is_hidden_when_invisible": {},
            "minecraft:loot": {
                "table": "loot_tables/empty.json"
            },
            "minecraft:collision_box": {
                "width": 0.6,
                "height": 1.8
            },
            "minecraft:can_climb": {},
            "minecraft:movement": {
                "value": 0.1
            },
            "minecraft:attack": {
                "damage": 1
            },
            "minecraft:exhaustion_values": {
                "heal": 6,
                "jump": 0.05,
                "sprint_jump": 0.2,
                "mine": 0.005,
                "attack": 0.1,
                "damage": 0.1,
                "walk": 0.0,
                "sprint": 0.01,
                "swim": 0.01
            },
            "minecraft:player.saturation": {
                "value": 5,
                "max": 20
            },
            "minecraft:player.exhaustion": {
                "value": 0,
                "max": 20
            },
            "minecraft:player.level": {
                "value": 0,
                "max": 24791
            },
            "minecraft:player.experience": {
                "value": 0,
                "max": 1
            },
            "minecraft:breathable": {
                "totalSupply": 15,
                "suffocateTime": -1,
                "inhaleTime": 3.75,
                "generatesBubbles": false
            },
            "minecraft:nameable": {
                "alwaysShow": true,
                "allowNameTagRenaming": false
            },
            "minecraft:physics": {},
			"minecraft:environment_sensor": {
				"triggers": [{
                        "filters": {
                            "all_of": [{
                                    "test": "has_tag",
									"operator": "==",
                                    "subject": "self",
                                    "value": "is_huggy"
                                }
                            ]
                        },
                        "event": "bd:as_huggy"
                    }, {
                        "filters": {
                            "all_of": [{
                                    "test": "has_tag",
									"operator": "!=",
                                    "subject": "self",
                                    "value": "is_huggy"
                                }
                            ]
                        },
                        "event": "bd:normal"
                    }
				]
			},
            "minecraft:scaffolding_climber": {}
        },

        "events": {
			"minecraft:entity_spawned": {
                "add": {
                    "component_groups": ["jumpscare_novent"]
                }
            },
			"bd:ban": {
                "add": {
                    "component_groups": ["ban"]
                }
            },
            "bd:normal": {
                "add": {
                    "component_groups": ["normal"]
                },
                "remove": {
                    "component_groups": ["as_huggy", "jumpscare_novent", "jumpscare_vent"]
                }
            },
			"bd:as_huggy": {
                "add": {
                    "component_groups": ["as_huggy"]
                },
				"remove": {
                    "component_groups": ["normal"]
                }
            },
			"bd:jumpscare_vent": {
                "add": {
                    "component_groups": ["jumpscare_vent"]
                },
				"remove": {
                    "component_groups": ["jumpscare_novent"]
                }
            },
			"bd:jumpscare_novent": {
                "add": {
                    "component_groups": ["jumpscare_novent"]
                },
				"remove": {
                    "component_groups": ["jumpscare_vent"]
                }
            },
			"bd:huggy_calm": {
                "add": {
                    "component_groups": ["huggy_calm", "huggy_not_statue"]
                },
				"remove": {
                    "component_groups": ["huggy_hunt", "huggy_catch", "huggy_hug", "huggy_statue_form"]
                }
            },
			"bd:huggy_hunt": {
                "add": {
                    "component_groups": ["huggy_hunt", "huggy_not_statue"]
                },
				"remove": {
                    "component_groups": ["huggy_calm", "huggy_statue_form"]
                }
            },
			"bd:huggy_catch": {
                "add": {
                    "component_groups": ["huggy_catch"]
                }
            },
			"bd:huggy_hug": {
                "remove": {
                    "component_groups": ["huggy_catch"]
                },
				"add": {
                    "component_groups": ["huggy_hug"]
                },
				"run_command": {
					"command": [
						"ride @s summon_rider bd:huggy_hug_player"
					],
					"target": "self"
				}
            },
			"bd:stop_hug": {
                "remove": {
                    "component_groups": ["huggy_hug"]
                }
            },
			"bd:huggy_statue_form": {
                "add": {
                    "component_groups": ["huggy_statue_form"]
                },
				"remove": {
                    "component_groups": ["huggy_not_statue"]
                }
            },
			"bd:huggy_statue_form_stop": {
				"add": {
                    "component_groups": ["huggy_not_statue"]
                },
                "remove": {
                    "component_groups": ["huggy_statue_form"]
                }
            }
        }
    }
}