{
  "format_version": "1.26.20",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:zoglin",
      "is_summonable": true,
      "is_spawnable": true,
      "spawn_category": "monster"
    },
    "components": {
      "minecraft:balloonable": {},
      "minecraft:behavior.look_at_player": {
        "look_distance": 6,
        "priority": 8
      },
      "minecraft:behavior.melee_box_attack": {
        "speed_multiplier": 1.15,
        "track_target": true,
        "priority": 4
      },
      "minecraft:behavior.nearest_attackable_target": {
        "must_see": true,
        "within_radius": 16,
        "entity_types": [
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "operator": "!=",
                  "value": "zoglin"
                },
                {
                  "test": "is_family",
                  "subject": "other",
                  "operator": "!=",
                  "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": 13
        }
      },
      "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": {},
      "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
      },
      "minecraft:offspring": {
        "offspring_pairs": {
          "minecraft:zoglin": "minecraft:zoglin"
        }
      },
      "minecraft:on_target_acquired": {
        "event": "become_angry_event",
        "target": "self"
      },
      "minecraft:physics": {},
      "minecraft:pushable_by_entity": {
      },
      "minecraft:pushable_by_block": {
      },
      "minecraft:spawn_egg_interaction": {}
    },
    "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:leashable_to": {},
        "minecraft:type_family": {
          "family": [
            "zoglin",
            "zoglin_adult",
            "undead",
            "monster",
            "mob"
          ]
        }
      },
      "zoglin_baby": {
        "minecraft:attack": {
          "damage": 0.5
        },
        "minecraft:collision_box": {
          "height": 1.7,  // 0.85/0.5
          "width": 1.5    // 0.75/0.5
        },
        "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:entity_born": {
        "trigger": "minecraft:as_baby"
      },
      "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"
              ]
            }
          }
        ]
      }
    }
  }
}
