{
  "format_version": "1.26.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:happy_ghast",
      "is_summonable": true,
      "is_spawnable": true,
      "properties": {
        "minecraft:can_move": {
          "client_sync": true,
          "default": true,
          "type": "bool"
        }
      },
      "spawn_category": "creature"
    },
    "components": {
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:body_rotation_always_follows_head": {},
      "minecraft:can_fly": {},
      "minecraft:collision_box": {
        "height": 4,
        "width": 4
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "cause": "fall",
            "deals_damage": "no"
          }
        ]
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:follow_range": {
        "max": 16,
        "value": 16
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "cause": "lava",
            "damage_per_tick": 4,
            "filters": {
              "test": "in_lava"
            }
          }
        ]
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:is_tamed": {},
      "minecraft:jump.static": {},
      "minecraft:leashable": {
        "on_unleash": {
          "event": "minecraft:on_unleashed",
          "target": "self"
        },
        "presets": [
          {
            "hard_distance": 10,
            "max_distance": 14
          }
        ]
      },
      "minecraft:nameable": {},
      "minecraft:physics": {
        "has_gravity": false
      },
      "minecraft:renders_when_invisible": {},
      "minecraft:type_family": {
        "family": [
          "happy_ghast",
          "mob"
        ]
      }
    },
    "component_groups": {
      "minecraft:adult": {
        "minecraft:breathable": {
          "breathes_air": true,
          "suffocate_time": 0,
          "breathes_water": false,
          "total_supply": 5
        },
        "minecraft:entity_sensor": {
          "find_players_only": true,
          "relative_range": false,
          "subsensors": [
            {
              "cooldown": 0,
              "minimum_count": 0,
              "event": "minecraft:become_mobile",
              // This filter must match exactly the one used by "minecraft:become_mobile".
              "event_filters": {
                "all_of": [
                  {
                    "test": "is_vehicle_family",
                    "operator": "not",
                    "subject": "other",
                    "value": "happy_ghast"
                  },
                  {
                    "test": "actor_health",
                    "operator": ">",
                    "value": 0
                  }
                ]
              },
              "maximum_count": 0,
              "range": [
                3.5,
                2
              ],
              "y_offset": 4.5
            },
            {
              "cooldown": 0,
              "minimum_count": 1,
              "event": "minecraft:become_immobile",
              // This filter must match exactly the one used by "minecraft:become_immobile".
              "event_filters": {
                "all_of": [
                  {
                    "test": "is_vehicle_family",
                    "operator": "not",
                    "subject": "other",
                    "value": "happy_ghast"
                  },
                  {
                    "test": "actor_health",
                    "operator": ">",
                    "value": 0
                  }
                ]
              },
              "range": [
                3,
                1.5
              ],
              "y_offset": 4.5
            }
          ]
        },
        "minecraft:experience_reward": {
          "on_death": {
            "expression": "query.last_hit_by_player ? Math.Random(1,3) : 0",
            "version": 13
          }
        },
        "minecraft:health": {
          "max": 20,
          "value": 20
        },
        "minecraft:leashable_to": {},
        "minecraft:navigation.float": {
          "avoid_damage_blocks": true,
          "avoid_water": true,
          "can_path_over_water": true
        }
      },
      "minecraft:baby": {
        "minecraft:ageable": {
          "duration": 1200,
          "grow_up": {
            "event": "minecraft:ageable_grow_up",
            "target": "self"
          },
          "feed_items": [
            "minecraft:snowball"
          ]
        },
        "minecraft:behavior.follow_mob": {
          "filters": {
            "all_of": [
              {
                "subject": "other",
                "test": "is_underwater",
                "value": false
              },
              {
                "subject": "other",
                "test": "is_baby",
                "value": false
              },
              {
                "any_of": [
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "player"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "armadillo"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "bee"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "camel"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "cat"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "chicken"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "cow"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "donkey"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "fox"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "goat"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "happy_ghast"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "horse"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "skeleton_horse"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "llama"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "mule"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "ocelot"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "panda"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "parrot"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "pig"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "polar_bear"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "rabbit"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "sheep"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "sniffer"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "strider"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "villager"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "villager_v2"
                  },
                  {
                    "subject": "other",
                    "test": "is_family",
                    "value": "wolf"
                  }
                ]
              }
            ]
          },
          "stop_distance": 5,
          "preferred_actor_type": "player",
          "use_home_position_restriction": true,
          "priority": 6,
          "search_range": 16,
          "speed_multiplier": 1.1
        },
        "minecraft:behavior.panic": {
          "priority": 2,
          "speed_multiplier": 2
        },
        "minecraft:behavior.random_hover": {
          "y_dist": 8,
          "hover_height": [
            1,
            4
          ],
          "xz_dist": 8,
          "interval": 1,
          "priority": 8,
          "y_offset": -1
        },
        "minecraft:behavior.tempt": {
          "can_tempt_vertically": true,
          "on_tempt_end": {
            "event": "minecraft:on_stop_tempting"
          },
          "items": [
            "minecraft:snowball"
          ],
          "priority": 3,
          "speed_multiplier": 1.25,
          "within_radius": 16
        },
        "minecraft:breathable": {
          "breathes_air": true,
          "suffocate_time": 0,
          "breathes_water": true,
          "total_supply": 5
        },
        "minecraft:flying_speed": {
          "value": 0.0833333
        },
        "minecraft:health": {
          "max": 20,
          "value": 20
        },
        "minecraft:home": {
          "restriction_radius": 32,
          "restriction_type": "random_movement"
        },
        "minecraft:is_baby": {},
        "minecraft:movement": {
          "value": 0.3
        },
        "minecraft:movement.hover": {},
        "minecraft:navigation.hover": {
          "can_path_from_air": true,
          "avoid_damage_blocks": true,
          "avoid_water": true,
          "can_path_over_water": true
        },
        "minecraft:pushable": {
          "is_pushable": true,
          "is_pushable_by_piston": true
        },
        "minecraft:scale": {
          "value": 0.2375 // Resulting in a final size of 0.95.
        }
      },
      "minecraft:adult_harnessed": {
        "minecraft:behavior.float_tempt": {
          "can_tempt_vertically": true,
          "on_tempt_end": {
            "event": "minecraft:on_stop_tempting"
          },
          "items": [
            "minecraft:snowball"
          ],
          "priority": 5,
          "within_radius": 16,
          "stop_distance": 7
        },
        "minecraft:behavior.player_ride_tamed": {
          "priority": 1
        },
        "minecraft:free_camera_controlled": {
          "backwards_movement_modifier": 0.5,
          "strafe_speed_modifier": 1
        },
        "minecraft:home": {
          "restriction_radius": 32,
          "restriction_type": "random_movement"
        },
        "minecraft:interact": {
          "interactions": [
            {
              "drop_item_slot": "slot.armor.body",
              "drop_item_y_offset": 5,
              "hurt_item": 1,
              "on_interact": {
                "event": "minecraft:on_unharnessed",
                "filters": {
                  "all_of": [
                    {
                      "subject": "other",
                      "test": "is_sneak_held",
                      "value": false
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "shears"
                    },
                    {
                      "test": "rider_count",
                      "operator": "equals",
                      "subject": "self",
                      "value": 0
                    }
                  ]
                },
                "target": "self"
              },
              "interact_text": "action.interact.removeharness",
              "play_sounds": "armor.unequip_generic",
              "vibration": "shear",
              "swing": false
            }
          ]
        },
        "minecraft:rideable": {
          "dismount_mode": "on_top_center",
          "family_types": [
            "player"
          ],
          "on_rider_exit_event": "minecraft:on_passenger_dismount",
          "interact_text": "action.interact.ride.horse",
          "seats": [
            {
              "position": [
                0,
                3.8,
                1.7
              ],
              "max_rider_count": 4,
              "camera_relax_distance_smoothing": 6,
              "min_rider_count": 0,
              "third_person_camera_radius": 8
            },
            {
              "position": [
                -1.7,
                3.8,
                0
              ],
              "max_rider_count": 4,
              "camera_relax_distance_smoothing": 6,
              "min_rider_count": 1,
              "third_person_camera_radius": 8
            },
            {
              "position": [
                0,
                3.8,
                -1.7
              ],
              "max_rider_count": 4,
              "camera_relax_distance_smoothing": 6,
              "min_rider_count": 2,
              "third_person_camera_radius": 8
            },
            {
              "position": [
                1.7,
                3.8,
                0
              ],
              "max_rider_count": 4,
              "camera_relax_distance_smoothing": 6,
              "min_rider_count": 3,
              "third_person_camera_radius": 8
            }
          ],
          "on_rider_enter_event": "minecraft:on_passenger_mount",
          "seat_count": 4
        },
        "minecraft:vertical_movement_action": {
          "vertical_velocity": 0.5
        }
      },
      "minecraft:adult_immobile": {
        "minecraft:body_rotation_blocked": {},
        "minecraft:flying_speed": {
          "value": 0
        },
        "minecraft:is_collidable": {},
        "minecraft:knockback_resistance": {
          "value": 1
        },
        "minecraft:movement": {
          "value": 0
        },
        "minecraft:pushable": {
          "is_pushable": false,
          "is_pushable_by_piston": true
        },
        "minecraft:rotation_axis_aligned": {}
      },
      "minecraft:adult_mobile": {
        "minecraft:behavior.float_wander": {
          "navigate_around_surface": true,
          "random_reselect": true,
          "additional_collision_buffer": true,
          "allow_navigating_through_liquids": false,
          "float_duration": [
            2,
            7
          ],
          "must_reach": true,
          "priority": 7,
          "surface_xz_dist": 16,
          "surface_y_dist": 16,
          "use_home_position_restriction": true
        },
        "minecraft:flying_speed": {
          "value": 0.016
        },
        "minecraft:knockback_resistance": {
          "value": 0
        },
        "minecraft:movement": {
          "value": 0.016
        },
        "minecraft:pushable": {
          "is_pushable": true,
          "is_pushable_by_piston": true
        }
      },
      "minecraft:adult_with_passengers": {
        "minecraft:ambient_sound_interval": {
          "value": 30
        }
      },
      "minecraft:adult_unharnessed": {
        "minecraft:behavior.float_tempt": {
          "can_tempt_vertically": true,
          "on_tempt_end": {
            "event": "minecraft:on_stop_tempting"
          },
          "items": [
            "minecraft:snowball",
            "minecraft:black_harness",
            "minecraft:blue_harness",
            "minecraft:brown_harness",
            "minecraft:cyan_harness",
            "minecraft:gray_harness",
            "minecraft:green_harness",
            "minecraft:light_blue_harness",
            "minecraft:light_gray_harness",
            "minecraft:lime_harness",
            "minecraft:magenta_harness",
            "minecraft:orange_harness",
            "minecraft:pink_harness",
            "minecraft:purple_harness",
            "minecraft:red_harness",
            "minecraft:white_harness",
            "minecraft:yellow_harness"
          ],
          "priority": 4,
          "within_radius": 16,
          "stop_distance": 7
        },
        "minecraft:home": {
          "restriction_radius": 64,
          "restriction_type": "random_movement"
        },
        "minecraft:interact": {
          "interactions": [
            {
              "play_sounds": "armor.equip_generic",
              "equip_item_slot": "slot.armor.body",
              "on_interact": {
                "event": "minecraft:on_harnessed",
                "filters": {
                  "any_of": [
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "black_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "blue_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "brown_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "cyan_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "gray_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "green_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "light_blue_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "light_gray_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "lime_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "magenta_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "orange_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "pink_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "purple_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "red_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "white_harness"
                    },
                    {
                      "domain": "hand",
                      "subject": "other",
                      "test": "has_equipment",
                      "value": "yellow_harness"
                    }
                  ]
                },
                "target": "self"
              },
              "interact_text": "action.interact.equipharness",
              "swing": false,
              "use_item": true
            }
          ]
        }
      },
      "minecraft:adult_without_passengers": {
        "minecraft:ambient_sound_interval": {
          "value": 5
        }
      }
    },
    "events": {
      "minecraft:ageable_grow_up": {
        "add": {
          "component_groups": [
            "minecraft:adult",
            "minecraft:adult_mobile",
            "minecraft:adult_unharnessed",
            "minecraft:adult_without_passengers"
          ]
        },
        "set_property": {
          "minecraft:can_move": true
        },
        "remove": {
          "component_groups": [
            "minecraft:baby"
          ]
        }
      },
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "trigger": "minecraft:spawn_adult",
            "weight": 95
          },
          {
            "trigger": "minecraft:spawn_baby",
            "weight": 5
          }
        ]
      },
      "minecraft:become_immobile": {
        "filters": {
          "domain": "minecraft:can_move",
          "test": "bool_property",
          "value": true
        },
        "add": {
          "component_groups": [
            "minecraft:adult_immobile"
          ]
        },
        "set_property": {
          "minecraft:can_move": false
        },
        "remove": {
          "component_groups": [
            "minecraft:adult_mobile"
          ]
        },
        "stop_movement": {}
      },
      "minecraft:on_passenger_mount": {
        "sequence": [
          {
            "filters": {
              "test": "rider_count",
              "operator": "equals",
              "subject": "self",
              "value": 1
            },
            "add": {
              "component_groups": [
                "minecraft:adult_with_passengers"
              ]
            },
            "play_sound": {
              "sound": "attach"
            },
            "remove": {
              "component_groups": [
                "minecraft:adult_without_passengers"
              ]
            }
          }
        ]
      },
      "minecraft:spawn_adult": {
        "add": {
          "component_groups": [
            "minecraft:adult",
            "minecraft:adult_mobile",
            "minecraft:adult_unharnessed",
            "minecraft:adult_without_passengers"
          ]
        },
        "set_property": {
          "minecraft:can_move": true
        }
      },
      "minecraft:become_mobile": {
        "filters": {
          "domain": "minecraft:can_move",
          "test": "bool_property",
          "value": false
        },
        "add": {
          "component_groups": [
            "minecraft:adult_mobile"
          ]
        },
        "set_property": {
          "minecraft:can_move": true
        },
        "remove": {
          "component_groups": [
            "minecraft:adult_immobile"
          ]
        }
      },
      "minecraft:on_harnessed": {
        "add": {
          "component_groups": [
            "minecraft:adult_harnessed"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:adult_unharnessed"
          ]
        },
        "set_home_position": {}
      },
      "minecraft:on_passenger_dismount": {
        "sequence": [
          {
            "filters": {
              "test": "rider_count",
              "operator": "equals",
              "subject": "self",
              "value": 0
            },
            "add": {
              "component_groups": [
                "minecraft:adult_without_passengers"
              ]
            },
            "play_sound": {
              "sound": "detach"
            },
            "remove": {
              "component_groups": [
                "minecraft:adult_with_passengers"
              ]
            }
          },
          {
            "set_home_position": {},
            "trigger": "minecraft:on_player_detected_above"
          }
        ]
      },
      "minecraft:on_stop_tempting": {
        "set_home_position": {}
      },
      "minecraft:on_unharnessed": {
        "add": {
          "component_groups": [
            "minecraft:adult_unharnessed"
          ]
        },
        "remove": {
          "component_groups": [
            "minecraft:adult_harnessed"
          ]
        },
        "set_home_position": {}
      },
      "minecraft:on_unleashed": {
        "set_home_position": {}
      },
      "minecraft:spawn_baby": {
        "add": {
          "component_groups": [
            "minecraft:baby"
          ]
        }
      }
    }
  }
}