{
  "format_version": "1.26.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:zoglin",
      "is_summonable": true,
      "is_spawnable": true,
      "spawn_category": "monster"
    },
    "components": {
      "minecraft:balloonable": {},
      "minecraft:behavior.look_at_player": {
        "look_time": {
          "min": 1,
          "max": 2
        },
        "look_distance": 6,
        "priority": 8
      },
      "minecraft:behavior.melee_box_attack": {
        "speed_multiplier": 1.4,
        "track_target": true,
        "priority": 4
      },
      "minecraft:behavior.nearest_attackable_target": {
        "must_see": true,
        "within_radius": 16,
        "entity_types": [
          {
            "filters": {
              "AND": [
                {
                  "test": "is_family",
                  "subject": 1,
                  "operator": 1,
                  "value": "zoglin"
                },
                {
                  "test": "is_family",
                  "subject": 1,
                  "operator": 1,
                  "value": "creeper"
                }
              ]
            }
          }
        ],
        "priority": 3
      },
      "minecraft:behavior.random_look_around": {
        "priority": 9
      },
      "minecraft:behavior.random_stroll": {
        "priority": 7,
        "speed_multiplier": 1.0
      },
      "minecraft:breathable": {
        "breathes_water": true,
        "suffocate_time": 0,
        "total_supply": 15
      },
      "minecraft:can_climb": {},
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:despawn": {
        "filters": {
          "any_of": [
            {
              "all_of": [
                {
                  "test": "is_persistent",
                  "value": false
                },
                {
                  "operator": ">",
                  "test": "distance_to_nearest_player",
                  "value": 54
                }
              ]
            },
            {
              "all_of": [
                {
                  "test": "is_persistent",
                  "value": false
                },
                {
                  "subject": "self",
                  "test": "inactivity_timer",
                  "value": 30
                },
                {
                  "test": "random_chance",
                  "value": 800
                },
                {
                  "operator": ">",
                  "test": "distance_to_nearest_player",
                  "value": 32
                }
              ]
            }
          ]
        }
      },
      "minecraft:experience_reward": {
        "on_death": {
          "expression": "query.last_hit_by_player ? 5 : 0",
          "version": 12
        }
      },
      "minecraft:fire_immune": {},
      "minecraft:health": {
        "max": 40,
        "value": 40
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:jump.static": {},
      "minecraft:knockback_resistance": {
        "value": 0.6
      },
      "minecraft:leashable": {
        "can_be_cut": false,
        "can_be_stolen": false,
        "on_unleash_interact_only": true,
        "presets": [
          {
            "hard_distance": 6.0,
            "max_distance": 10.0,
            "spring_type": "bouncy",
            "soft_distance": 4.0
          }
        ]
      },
      "minecraft:loot": {
        "table": "loot_tables/entities/zoglin.json"
      },
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:movement.basic": {},
      "minecraft:nameable": {},
      "minecraft:navigation.walk": {
        "avoid_damage_blocks": true,
        "avoid_water": true,
        "can_path_over_water": false,
        "is_amphibious": true,
        "using_door_annotation": true
      },
      "minecraft:on_target_acquired": {
        "event": "become_angry_event",
        "target": "self"
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      }
    },
    "component_groups": {
      "angry_zoglin": {
        "minecraft:angry": {
          "angry_sound": "angry",
          "calm_event": {
            "event": "become_calm_event",
            "target": "self"
          },
          "duration": 10,
          "sound_interval": {
            "range_max": 5.0,
            "range_min": 2.0
          }
        }
      },
      "zoglin_adult": {
        "minecraft:attack": {
          "damage": [
            3,
            8
          ]
        },
        "minecraft:behavior.hurt_by_target": {
          "priority": 1
        },
        "minecraft:collision_box": {
          "height": 1.4,
          "width": 1.4
        },
        "minecraft:custom_hit_test": {
          "hitboxes": [
            {
              "height": 1.75,
              "pivot": [
                0,
                1,
                0
              ],
              "width": 2.0
            }
          ]
        },
        "minecraft:type_family": {
          "family": [
            "zoglin",
            "zoglin_adult",
            "undead",
            "monster",
            "mob"
          ]
        }
      },
      "zoglin_baby": {
        "minecraft:attack": {
          "damage": 0.5
        },
        "minecraft:collision_box": {
          "height": 0.85,
          "width": 0.85
        },
        "minecraft:custom_hit_test": {
          "hitboxes": [
            {
              "height": 0.85,
              "pivot": [
                0,
                0.5,
                0
              ],
              "width": 1.0
            }
          ]
        },
        "minecraft:is_baby": {},
        "minecraft:scale": {
          "value": 0.5
        },
        "minecraft:type_family": {
          "family": [
            "zoglin",
            "zoglin_baby",
            "undead",
            "monster",
            "mob"
          ]
        }
      }
    },
    "events": {
      "become_calm_event": {
        "remove": {
          "component_groups": [
            "angry_zoglin"
          ]
        }
      },
      "become_angry_event": {
        "add": {
          "component_groups": [
            "angry_zoglin"
          ]
        }
      },
      "minecraft:as_adult": {
        "add": {
          "component_groups": [
            "zoglin_adult"
          ]
        }
      },
      "minecraft:as_baby": {
        "add": {
          "component_groups": [
            "zoglin_baby"
          ]
        }
      },
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "add": {
              "component_groups": [
                "zoglin_adult"
              ]
            },
            "weight": 95
          },
          {
            "add": {
              "component_groups": [
                "zoglin_baby"
              ]
            },
            "weight": 5
          }
        ]
      },
      "minecraft:entity_transformed": {
        "sequence": [
          {
            "filters": {
              "subject": "other",
              "test": "has_component",
              "value": "minecraft:is_baby"
            },
            "add": {
              "component_groups": [
                "zoglin_baby"
              ]
            }
          },
          {
            "filters": {
              "test": "has_component",
              "operator": "!=",
              "subject": "other",
              "value": "minecraft:is_baby"
            },
            "add": {
              "component_groups": [
                "zoglin_adult"
              ]
            }
          }
        ]
      }
    }
  }
}