{
    "format_version": "1.21.130",
    "minecraft:entity": {
        "description": {
            "identifier": "minecraft:camel_husk",
            "spawn_category": "monster",
            "is_spawnable": true,
            "is_summonable": true,
            "properties": {
                "minecraft:has_rider_mounted": {
                    "type": "bool",
                    "default": false,
                    "client_sync": false
                }
            }
        },

        "component_groups": {
            "minecraft:camel_husk_saddled": {
                "minecraft:is_saddled": {
                },
                "minecraft:input_ground_controlled": {
                },
                "minecraft:behavior.player_ride_tamed": {
                    "priority": 1
                },
                "minecraft:dash_action": {
                    "cooldown_time": 2.75,
                    "horizontal_momentum": 20.0,
                    "vertical_momentum": 0.6
                }
            },
            "minecraft:camel_husk_with_hostile_rider": {
                "minecraft:addrider": {
                    "riders": [
                        {
                            "entity_type": "minecraft:husk",
                            "spawn_event": "minecraft:spawn_as_rider"
                        },
                        {
                            "entity_type": "minecraft:parched",
                            "spawn_event": "minecraft:ranged_mode"
                        }
                    ]
                }
            },
            "minecraft:camel_husk_with_no_hostile_rider": {
                "minecraft:leashable": {
                    "presets": [
                        {
                            "filter": {
                                "test": "is_family",
                                "subject": "other",
                                "value": "happy_ghast"
                            },
                            "spring_type": "quad_dampened"
                        }
                    ]
                },
                "minecraft:leashable_to": {
                },
                "minecraft:behavior.tempt": {
                    "priority": 4,
                    "speed_multiplier": 2.5,
                    "can_tempt_vertically": true,
                    "items": [ "rabbit_foot" ]
                },
                "minecraft:equippable": {
                    "slots": [
                        {
                            "slot": 0,
                            "item": "saddle",
                            "accepted_items": [ "saddle" ],
                            "on_equip": {
                                "event": "minecraft:camel_husk_saddled"
                            },
                            "on_unequip": {
                                "event": "minecraft:camel_husk_unsaddled"
                            }
                        }
                    ]
                },
                "minecraft:interact": {
                    "interactions": [
                        {
                            "play_sounds": "saddle",
                            "on_interact": {
                                "filters": {
                                    "all_of": [
                                        {
                                            "test": "has_equipment",
                                            "subject": "self",
                                            "domain": "inventory",
                                            "operator": "not",
                                            "value": "saddle"
                                        },
                                        {
                                            "test": "has_equipment",
                                            "subject": "other",
                                            "domain": "hand",
                                            "value": "saddle"
                                        },
                                        {
                                            "test": "is_sneak_held",
                                            "subject": "other",
                                            "value": false
                                        }
                                    ]
                                }
                            },
                            "equip_item_slot": "0",
                            "interact_text": "action.interact.saddle"
                        },
                        // Removing the Saddle while the Camel is standing. Keep consistent with the next interaction.
                        {
                            "on_interact": {
                                "filters": {
                                    "all_of": [
                                        {
                                            "test": "is_sitting",
                                            "subject": "self",
                                            "value": false
                                        },
                                        {
                                            "test": "rider_count",
                                            "subject": "self",
                                            "operator": "equals",
                                            "value": 0
                                        },
                                        {
                                            "test": "has_equipment",
                                            "subject": "self",
                                            "domain": "inventory",
                                            "value": "saddle"
                                        },
                                        {
                                            "test": "has_equipment",
                                            "subject": "other",
                                            "domain": "hand",
                                            "value": "shears"
                                        },
                                        {
                                            "test": "is_sneak_held",
                                            "subject": "other",
                                            "value": false
                                        }
                                    ]
                                }
                            },
                            "hurt_item": 1,
                            "drop_item_slot": "0",
                            // Bigger offset when the Camel is standing.
                            "drop_item_y_offset": 2,
                            "interact_text": "action.interact.removesaddle",
                            "play_sounds": "unsaddle",
                            "vibration": "shear"
                        },
                        // Removing the Saddle while the Camel is sitting. Keep consistent with the previous interaction.
                        {
                            "on_interact": {
                                "filters": {
                                    "all_of": [
                                        {
                                            "test": "is_sitting",
                                            "subject": "self"
                                        },
                                        {
                                            "test": "rider_count",
                                            "subject": "self",
                                            "operator": "equals",
                                            "value": 0
                                        },
                                        {
                                            "test": "has_equipment",
                                            "subject": "self",
                                            "domain": "inventory",
                                            "value": "saddle"
                                        },
                                        {
                                            "test": "has_equipment",
                                            "subject": "other",
                                            "domain": "hand",
                                            "value": "shears"
                                        },
                                        {
                                            "test": "is_sneak_held",
                                            "subject": "other",
                                            "value": false
                                        }
                                    ]
                                }
                            },
                            "hurt_item": 1,
                            "drop_item_slot": "0",
                            // Smaller offset when the Camel is sitting.
                            "drop_item_y_offset": 1,
                            "interact_text": "action.interact.removesaddle",
                            "play_sounds": "unsaddle",
                            "vibration": "shear"
                        }
                    ]
                }
            },
            "minecraft:camel_husk_with_no_rider": {
                "minecraft:behavior.panic": {
                    "priority": 2,
                    "speed_multiplier": 4
                }
            },
            "minecraft:camel_husk_standing": {
                "minecraft:pushable": {
                    "is_pushable": true,
                    "is_pushable_by_piston": true
                },
                "minecraft:collision_box": {
                    "width": 1.7,
                    "height": 2.375
                }
            },
            "minecraft:camel_husk_sitting": {
                "minecraft:pushable": {
                    "is_pushable": false,
                    "is_pushable_by_piston": true
                },
                "minecraft:collision_box": {
                    "width": 1.7,
                    "height": 0.945
                }
            }
        },

        "components": {
            // This component prevents Camel Husk from spawning in spaces it doesn't fit. Without it, the correct collision box wont be set until the sitting/standing events are triggered.
            "minecraft:collision_box": {
                "width": 1.7,
                "height": 2.375
            },
            "minecraft:healable": {
                "items": [
                    {
                        "item": "rabbit_foot",
                        "heal_amount": 2
                    }
                ]
            },
            "minecraft:balloonable": {
            },
            "minecraft:type_family": {
                "family": [ "camel_husk", "mob", "undead" ]
            },
            "minecraft:is_hidden_when_invisible": {
            },
            "minecraft:breathable": {
                "total_supply": 15,
                "suffocate_time": 0,
                "breathes_air": true,
                "breathes_water": true
            },
            "minecraft:nameable": {
            },
            "minecraft:loot": {
                "table": "loot_tables/entities/camel_husk.json"
            },
            "minecraft:health": {
                "value": 32
            },
            "minecraft:hurt_on_condition": {
                "damage_conditions": [
                    {
                        "filters": {
                            "test": "in_lava",
                            "subject": "self"
                        },
                        "cause": "lava",
                        "damage_per_tick": 4
                    }
                ]
            },
            "minecraft:damage_sensor": {
                "triggers": {
                    "cause": "fall",
                    "deals_damage": "yes",
                    "damage_modifier": -4
                }
            },
            "minecraft:navigation.walk": {
                "can_path_over_water": true,
                "avoid_damage_blocks": true
            },
            "minecraft:movement.basic": {
            },
            "minecraft:jump.static": {
            },
            "minecraft:can_climb": {
            },
            "minecraft:movement": {
                "value": 0.09
            },
            "minecraft:despawn": {
                "despawn_from_distance": {}
            },
            "minecraft:physics": {
            },
            "minecraft:conditional_bandwidth_optimization": {
            },
            "minecraft:behavior.float": {
                "priority": 0,
                "chance_per_tick_to_float": 1.0,
                "time_under_water_to_dismount_passengers": 2.0
            },
            "minecraft:behavior.random_look_around_and_sit": {
                "priority": 5,
                "continue_if_leashed": true,
                "continue_sitting_on_reload": true,
                "min_look_count": 2,
                "max_look_count": 5,
                "min_look_time": 80,
                "max_look_time": 100,
                "min_angle_of_view_horizontal": -30,
                "max_angle_of_view_horizontal": 30,
                "random_look_around_cooldown": 5,
                "probability": 0.001
            },
            "minecraft:behavior.random_stroll": {
                "priority": 7,
                "speed_multiplier": 2
            },
            "minecraft:behavior.look_at_player": {
                "priority": 8,
                "target_distance": 6.0,
                "probability": 0.02
            },
            "minecraft:behavior.random_look_around": {
                "priority": 9
            },
            "minecraft:variable_max_auto_step": {
                "base_value": 1.5625,
                "controlled_value": 1.5625,
                "jump_prevented_value": 0.5625
            },
            "minecraft:inventory": {
                "container_type": "horse"
            },
            "minecraft:experience_reward": {
                "on_bred": "Math.Random(1,7)",
                "on_death": "query.last_hit_by_player ? Math.Random(1,3) : 0"
            },
            "minecraft:is_tamed": {
            },
            "minecraft:rideable": {
                "seat_count": 2,
                "crouching_skip_interact": true,
                "family_types": [
                    "player",
                    "parched",
                    "husk_rider"
                ],
                "interact_text": "action.interact.ride.horse",
                "seats": [
                    {
                        "min_rider_count": 0,
                        "max_rider_count": 2,
                        "position": [ 0.0, 1.905, 0.5 ]
                    },
                    {
                        "min_rider_count": 1,
                        "max_rider_count": 2,
                        "position": [ 0.0, 1.905, -0.5 ]
                    }
                ]
            },
            "minecraft:behavior.mount_pathing": {
                "priority": 3,
                "speed_multiplier": 4,
                "target_dist": 0.0,
                "track_target": true
            },
            "minecraft:environment_sensor": {
                "triggers": [
                    {
                        "filters": {
                            "all_of": [
                                {
                                    "test": "bool_property",
                                    "domain": "minecraft:has_rider_mounted"
                                },
                                {
                                    "test": "rider_count",
                                    "subject": "self",
                                    "value": 0
                                }
                            ]
                        },
                        "event": "minecraft:all_riders_dismounted"
                    },
                    {
                        "filters": {
                            "all_of": [
                                {
                                    "test": "bool_property",
                                    "domain": "minecraft:has_rider_mounted",
                                    "value": false
                                },
                                {
                                    "test": "rider_count",
                                    "subject": "self",
                                    "operator": ">",
                                    "value": 0
                                }
                            ]
                        },
                        "event": "minecraft:rider_mounted"
                    }
                ]
            }
        },

        "events": {
            "minecraft:entity_spawned": {
                "add": {
                    "component_groups": [
                        "minecraft:camel_husk_standing",
                        "minecraft:camel_husk_with_no_rider",
                        "minecraft:camel_husk_with_no_hostile_rider"
                    ]
                }
            },
            "minecraft:spawn_with_rider": {
                "add": {
                    "component_groups": [
                        "minecraft:camel_husk_standing",
                        "minecraft:camel_husk_with_hostile_rider"
                    ]
                },
                "remove": {
                    "component_groups": [
                        "minecraft:camel_husk_with_no_rider",
                        "minecraft:camel_husk_with_no_hostile_rider"
                    ]
                },
                "set_property": {
                    "minecraft:has_rider_mounted": true
                }
            },
            "minecraft:camel_husk_saddled": {
                "add": {
                    "component_groups": [
                        "minecraft:camel_husk_saddled"
                    ]
                }
            },
            "minecraft:camel_husk_unsaddled": {
                "remove": {
                    "component_groups": [
                        "minecraft:camel_husk_saddled"
                    ]
                }
            },
            "minecraft:start_sitting": {
                "add": {
                    "component_groups": [
                        "minecraft:camel_husk_sitting"
                    ]
                },
                "remove": {
                    "component_groups": [
                        "minecraft:camel_husk_standing"
                    ]
                }
            },
            "minecraft:stop_sitting": {
                "add": {
                    "component_groups": [
                        "minecraft:camel_husk_standing"
                    ]
                },
                "remove": {
                    "component_groups": [
                        "minecraft:camel_husk_sitting"
                    ]
                }
            },
            "minecraft:all_riders_dismounted": {
                "add": {
                    "component_groups": [
                        "minecraft:camel_husk_with_no_rider",
                        "minecraft:camel_husk_with_no_hostile_rider"
                    ]
                },
                "remove": {
                    "component_groups": [
                        "minecraft:camel_husk_with_hostile_rider"
                    ]
                },
                "set_property": {
                    "minecraft:has_rider_mounted": false
                }
            },
            "minecraft:rider_mounted": {
                "remove": {
                    "component_groups": [
                        "minecraft:camel_husk_with_no_rider"
                    ]
                },
                "set_property": {
                    "minecraft:has_rider_mounted": true
                }
            }
        }
    }
}
