{
   "format_version":"1.21.0",
   "minecraft:entity":{
      "description":{
         "identifier":"true:zombie_pig",
         "spawn_category":"creature",
         "is_spawnable":true,
         "is_summonable":true
      },
      "component_groups":{
         "true:default":{
            "minecraft:variant":{
               "value":0
            },
            "minecraft:damage_sensor":{
               "triggers":[
                  {
                     "on_damage":{
                        "filters":{
                           "all_of":[
                              {
                                 "test":"has_damage",
                                 "value":"fatal"
                              }
                           ]
                        },
                        "event":"true:to_dead"
                     }
                  }
               ]
            }
         },
         "true:dead":{
            "minecraft:transformation":{
               "into":"true:zombie_pig_corpse<true:to_default>"
            }
         },
         "true:peaceful":{
            "minecraft:transformation":{
               "into":"true:despawn"
            }
         }
      },
      "components":{
         "minecraft:type_family":{
            "family":[
               "apocalypse"
            ]
         },
         "minecraft:breathable":{
            "total_supply":15,
            "suffocate_time":0,
            "breathes_air":true,
            "breathes_water":false
         },
         "minecraft:timer":{
            "looping":false,
            "randomInterval":false,
            "time":180.0,
            "time_down_event":{
               "event":"true:to_peaceful"
            }
         },
         "minecraft:collision_box":{
            "width":0.9,
            "height":1.2
         },
         "minecraft:health":{
            "value":8,
            "max":8
         },
         "minecraft:scale":{
            "value":1
         },
         "minecraft:movement.basic":{
            
         },
         "minecraft:movement":{
            "value":0.16
         },
         "minecraft:underwater_movement":{
            "value":0.04
         },
         "minecraft:navigation.generic":{
            "can_break_doors":true,
            "can_path_over_water":false,
            "avoid_water":false,
            "avoid_damage_blocks":false,
            "can_swim":true,
            "can_breach":true,
            "can_sink":true
         },
         "minecraft:behavior.move_to_land":{
            "priority":3,
            "search_range":64,
            "search_height":5,
            "goal_radius":0.5
         },
         "minecraft:behavior.random_swim":{
            "priority":5,
            "interval":0,
            "xz_dist":20
         },
         "minecraft:can_climb":{
            
         },
         "minecraft:jump.static":{
            
         },
         "minecraft:attack":{
            "damage":2
         },
         "minecraft:behavior.melee_attack":{
            "priority":3
         },
         "minecraft:behavior.hurt_by_target":{
            "priority":1
         },
         "minecraft:despawn":{
            "filters":{
               "test":"distance_to_nearest_player",
               "subject":"self",
               "operator":">",
               "value":48
            }
         },
         "minecraft:behavior.random_look_around":{
            "priority":9
         },
         "minecraft:behavior.nearest_attackable_target":{
            "priority":0,
            "must_see":false,
            "reselect_targets":true,
            "within_radius":42.0,
            "entity_types":[
               {
                  "filters":{
                     "any_of":[
                        {
                           "test":"is_family",
                           "subject":"other",
                           "value":"human"
                        },
                        {
                           "test":"is_family",
                           "subject":"other",
                           "value":"animal"
                        },
                        {
                           "all_of":[
                              {
                                 "test":"has_tag",
                                 "subject":"other",
                                 "operator":"not",
                                 "value":"zombie_flesh_chestplate"
                              },
                              {
                                 "test":"is_family",
                                 "subject":"other",
                                 "value":"player"
                              }
                           ]
                        }
                     ]
                  },
                  "max_dist":24
               }
            ]
         },
         "minecraft:follow_range":{
            "value":12,
            "max":12
         },
         "minecraft:behavior.look_at_player":{
            "priority":7
         },
         "minecraft:behavior.random_stroll":{
            "priority":4,
            "speed_multiplier":1.0
         },
         "minecraft:knockback_resistance":{
            "value":0.3
         },
         "minecraft:behavior.avoid_mob_type":{
            "priority":1,
            "entity_types":[
               {
                  "filters":{
                     "any_of":[
                        {
                           "test":"is_family",
                           "subject":"other",
                           "value":"armless_zombie"
                        }
                     ]
                  },
                  "max_dist":6,
                  "walk_speed_multiplier":1.0
               }
            ]
         },
         "minecraft:persistent":{
            
         },
         "minecraft:environment_sensor":{
            "triggers":[
               {
                  "filters":{
                     "all_of":[
                        {
                           "test":"is_difficulty",
                           "subject":"self",
                           "operator":"equals",
                           "value":"peaceful"
                        }
                     ]
                  },
                  "event":"true:to_peaceful"
               }
            ]
         },
         "minecraft:on_hurt_by_player":{
            "event":"true:hurt",
            "target":"self"
         },
         "minecraft:on_hurt":{
            "event":"true:hurt",
            "target":"self"
         },
         "minecraft:pushable":{
            "is_pushable":true,
            "is_pushable_by_piston":true
         },
         "minecraft:physics":{
            
         }
      },
      "events":{
         "minecraft:entity_spawned":{
            "add":{
               "component_groups":[
                  "true:default"
               ]
            }
         },
         "true:to_default":{
            "add":{
               "component_groups":[
                  "true:default"
               ]
            }
         },
         "true:hurt":{
            "queue_command":{
               "command":[
                  "particle true:blood_splatter ^ ^1 ^",
                  "particle true:blood_splatter ^ ^2 ^"
               ]
            }
         },
         "true:to_peaceful":{
            "add":{
               "component_groups":[
                  "true:peaceful"
               ]
            }
         },
         "true:to_dead":{
            "add":{
               "component_groups":[
                  "true:dead"
               ]
            },
            "queue_command":{
               "command":[
                  "scoreboard players add @p kills 1",
                  "particle true:blood_splatter ^ ^1 ^",
                  "particle true:blood_splatter ^ ^2 ^"
               ]
            }
         }
      }
   }
}