{
  "format_version": "1.26.0",
  "minecraft:entity": {
    "description": {
      "identifier": "minecraft:zombie_pigman",
      "spawn_category": "monster",
      "is_spawnable": true,
      "is_summonable": true
    },

    "component_groups": {
      "minecraft:pig_zombie_baby": {
        "minecraft:experience_reward": {
          "on_death": "query.last_hit_by_player ? 12 + (query.equipment_count * Math.Random(1,3)) : 0"
        },
        "minecraft:is_baby": {
        },
        "minecraft:scale": {
          "value": 0.5
        },
        "minecraft:type_family": {
          "family": [ "baby_undead", "baby_zombie_pigman", "undead", "monster", "mob" ]
        }
      },
      "minecraft:pig_zombie_jockey": {
        "minecraft:behavior.find_mount": {
          "priority": 1,
          "within_radius": 16,
          "start_delay": 15,
          "max_failed_attempts": 20
        }
      },
      "minecraft:pig_zombie_adult": {
        "minecraft:rideable": {
          "seat_count": 1,
          "family_types": [
            "baby_undead"
          ],
          "seats": {
            "position": [ 0.0, 1.175, -0.35 ],
            "lock_rider_rotation": 0
          }
        },
        "minecraft:experience_reward": {
          "on_death": "query.last_hit_by_player ? 5 + (query.equipment_count * Math.Random(1,3)) : 0"
        },
        "minecraft:type_family": {
          "family": [ "zombie_pigman", "undead", "monster", "mob" ]
        }
      },
      "minecraft:pig_zombie_angry": {
        "minecraft:angry": {
          "duration": 25,
          "broadcast_anger": true,
          "broadcast_range": 20,
          "broadcast_anger_when_dying": false,
          "calm_event": {
            "event": "minecraft:on_calm",
            "target": "self"
          }
        }
      },
      "minecraft:pig_zombie_calm": {
        "minecraft:on_target_acquired": {
          "event": "minecraft:become_angry",
          "target": "self"
        }
      },
      "minecraft:strider_jockey": {
        "minecraft:equipment": {
          "table": "loot_tables/entities/zombified_piglin_rider_gear.json"
        }
      }
    },

    "components": {
      "minecraft:is_hidden_when_invisible": {
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0,
        "breathes_water": true
      },
      "minecraft:equip_item": {
      },
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 1.9
      },
      "minecraft:nameable": {
      },
      "minecraft:offspring": {
        "offspring_pairs": {
          "minecraft:zombie_pigman": "minecraft:zombie_pigman"
        }
      },
      "minecraft:spawn_egg_interaction": {},
      "minecraft:navigation.walk": {
        "is_amphibious": true,
        "can_pass_doors": true,
        "can_open_doors": true,
        "avoid_water": true,
        "avoid_portals": true,
        "can_path_over_lava": true
      },
      "minecraft:movement.basic": {
      },
      "minecraft:jump.static": {
      },
      "minecraft:can_climb": {
      },
      "minecraft:fire_immune": {
      },
      "minecraft:loot": {
        "table": "loot_tables/entities/zombie_pigman.json"
      },
      "minecraft:equipment": {
        "table": "loot_tables/entities/zombie_pigman_gear.json"
      },
      "minecraft:health": {
        "value": 20,
        "max": 20
      },
      "minecraft:movement": {
        "value": 0.23
      },
      "minecraft:attack": {
        "damage": 5
      },
      "minecraft:despawn": {
        "despawn_from_distance": {}
      },
      "minecraft:shareables": {
        "items": [
          {
            "item": "minecraft:netherite_sword",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 0
          },
          {
            "item": "minecraft:diamond_sword",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 1
          },
          {
            "item": "minecraft:iron_sword",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 2
          },
          {
            "item": "minecraft:golden_sword",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 3
          },
          {
            "item": "minecraft:copper_sword",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 4
          },
          {
            "item": "minecraft:stone_sword",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 5
          },
          {
            "item": "minecraft:wooden_sword",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 6
          },
          {
            "item": "minecraft:netherite_spear",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 0
          },
          {
            "item": "minecraft:diamond_spear",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 1
          },
          {
            "item": "minecraft:iron_spear",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 2
          },
          {
            "item": "minecraft:golden_spear",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 3
          },
          {
            "item": "minecraft:copper_spear",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 4
          },
          {
            "item": "minecraft:stone_spear",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 5
          },
          {
            "item": "minecraft:wooden_spear",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 6
          },
          {
            "item": "minecraft:netherite_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 0
          },
          {
            "item": "minecraft:diamond_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 1
          },
          {
            "item": "minecraft:iron_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 2
          },
          {
            "item": "minecraft:chainmail_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 3
          },
          {
            "item": "minecraft:golden_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 4
          },
          {
            "item": "minecraft:copper_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 5
          },
          {
            "item": "minecraft:leather_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 6
          },
          {
            "item": "minecraft:turtle_helmet",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 7
          },
          {
            "item": "minecraft:skull:0",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 8
          },
          {
            "item": "minecraft:skull:1",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 8
          },
          {
            "item": "minecraft:carved_pumpkin",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 8
          },
          {
            "item": "minecraft:netherite_chestplate",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 0
          },
          {
            "item": "minecraft:diamond_chestplate",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 1
          },
          {
            "item": "minecraft:iron_chestplate",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 2
          },
          {
            "item": "minecraft:chainmail_chestplate",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 3
          },
          {
            "item": "minecraft:golden_chestplate",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 4
          },
          {
            "item": "minecraft:copper_chestplate",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 5
          },
          {
            "item": "minecraft:leather_chestplate",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 6
          },
          {
            "item": "minecraft:netherite_leggings",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 0
          },
          {
            "item": "minecraft:diamond_leggings",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 1
          },
          {
            "item": "minecraft:iron_leggings",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 2
          },
          {
            "item": "minecraft:chainmail_leggings",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 3
          },
          {
            "item": "minecraft:golden_leggings",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 4
          },
          {
            "item": "minecraft:copper_leggings",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 5
          },
          {
            "item": "minecraft:leather_leggings",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 6
          },
          {
            "item": "minecraft:netherite_boots",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 0
          },
          {
            "item": "minecraft:diamond_boots",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 1
          },
          {
            "item": "minecraft:iron_boots",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 2
          },
          {
            "item": "minecraft:chainmail_boots",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 3
          },
          {
            "item": "minecraft:golden_boots",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 4
          },
          {
            "item": "minecraft:copper_boots",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 5
          },
          {
            "item": "minecraft:leather_boots",
            "want_amount": 1,
            "surplus_amount": 1,
            "priority": 6
          }
        ]
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:behavior.mount_pathing": {
        "priority": 2,
        "speed_multiplier": 1.25,
        "target_dist": 0,
        "track_target": true
      },
      "minecraft:behavior.equip_item": {
        "priority": 3
      },
      "minecraft:behavior.use_kinetic_weapon": {
        "priority": 4,
        "track_target": true,
        "approach_distance": 10.0,
        "reposition_distance": {
          "min": 6.0,
          "max": 7.0
        },
        "cooldown_distance": {
          "min": 9.0,
          "max": 11.0
        },
        "weapon_reach_multiplier": 0.5,
        "weapon_min_speed_multiplier": 0.2,
        "speed_multiplier": 1.5,
        "cooldown_speed_multiplier": 1.5,
        "hijack_mount_navigation": true
      },
      "minecraft:behavior.melee_box_attack": {
        "priority": 5,
        "speed_multiplier": 1.5
      },
      "minecraft:behavior.stomp_turtle_egg": {
        "priority": 6,
        "speed_multiplier": 1,
        "search_range": 10,
        "search_height": 2,
        "goal_radius": 1.14,
        "interval": 20
      },
      "minecraft:behavior.pickup_items": {
        "priority": 7,
        "max_dist": 3,
        "goal_radius": 2,
        "speed_multiplier": 1.0,
        "pickup_based_on_chance": true,
        "can_pickup_any_item": true
      },
      "minecraft:behavior.random_stroll": {
        "priority": 8,
        "speed_multiplier": 1.0
      },
      "minecraft:behavior.look_at_player": {
        "priority": 9,
        "look_distance": 6.0,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 10
      },
      "minecraft:physics": {
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },

    "events": {
      "minecraft:entity_transformed": {
        "sequence": [
          // Transform baby pig to baby zombie pigman
          {
            "filters": {
              "test": "has_component",
              "subject": "other",
              "value": "minecraft:is_baby"
            },
            "trigger": "spawn_baby"
          },
          // Transform adult pig to adult zombie pigman
          {
            "filters": {
              "test": "has_component",
              "subject": "other",
              "operator": "!=",
              "value": "minecraft:is_baby"
            },
            "trigger": "spawn_adult"
          }
        ]
      },
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 9500,
            "trigger": "spawn_adult"
          },
          {
            "weight": 425,
            "trigger": "spawn_baby"
          },
          {
            "weight": 75,
            "trigger": "spawn_baby_jockey"
          }
        ]
      },
      "spawn_adult": {
        "add": {
          "component_groups": [
            "minecraft:pig_zombie_adult",
            "minecraft:pig_zombie_calm"
          ]
        }
      },
      "spawn_baby": {
        "add": {
          "component_groups": [
            "minecraft:pig_zombie_baby",
            "minecraft:pig_zombie_calm"
          ]
        }
      },
      "minecraft:entity_born": {
        "trigger": "minecraft:as_baby"
      },
      "minecraft:as_baby": {
        "add": {
          "component_groups": [
            "minecraft:pig_zombie_baby",
            "minecraft:pig_zombie_calm"
          ]
        }
      },
      "minecraft:on_calm": {
        "remove": {
          "component_groups": [
            "minecraft:pig_zombie_angry"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:pig_zombie_calm"
          ]
        }
      },
      "minecraft:become_angry": {
        "remove": {
          "component_groups": [
            "minecraft:pig_zombie_calm"
          ]
        },
        "add": {
          "component_groups": [
            "minecraft:pig_zombie_angry"
          ]
        }
      },
      "minecraft:spawn_as_strider_jockey": {
        "add": {
          "component_groups": [
            "minecraft:strider_jockey"
          ]
        }
      }
    }
  }
}
