{
  "format_version": "1.16.0",
  "minecraft:entity": {
    "description": {
      "identifier": "nicothekid:warthog",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "component:warthog_adult": {
        "minecraft:health": {
          "value": 20,
          "max": 20
        },
        "minecraft:scale": {
          "value": 0.8
        },
        
        "minecraft:breedable": {
          "allow_sitting": false,
          "causes_pregnancy": false,
          "inherit_tamed": false,
          "require_full_health": true,
          "require_tame": false,
          "extra_baby_chance": 0,
          "breed_cooldown": 60,
          "breed_items": [
            "minecraft:apple",
            "minecraft:beetroot",
            "minecraft:carrot",
            "minecraft:potato"
          ],
          "breeds_with": {
            "mate_type": "nicothekid:warthog",
            "baby_type": "nicothekid:warthog",
            "breed_event": {
              "event": "minecraft:entity_born",
              "target": "baby"
            }
          }
        },
        "minecraft:behavior.breed": {
          "priority": 2,
          "speed_multiplier": 1.0
        },
        
        "minecraft:experience_reward": {
          "on_bred": "Math.Random(1,7)",
          "on_death": "query.last_hit_by_player ? Math.Random(1,3) : 0"
        },
        "minecraft:loot": {
          "table": "loot_tables/nicos_mobs/entities/nicothekid_warthog.json"
        }
      },
      "component:warthog_baby": {
        "minecraft:health": {
          "value": 10,
          "max": 10
        },
        "minecraft:is_baby": {},
        "minecraft:scale": {
          "value": 0.4
        },
        
        "minecraft:ageable": {
          "duration": 2000,
          "feed_items": [
            {
              "item": "minecraft:apple",
              "growth": 0.15
            },
            {
              "item": "minecraft:beetroot",
              "growth": 0.05
            },
            {
              "item": "minecraft:carrot",
              "growth": 0.10
            },
            {
              "item": "minecraft:potato",
              "growth": 0.08
            }
          ],
          "grow_up": {
            "event": "minecraft:ageable_grow_up",
            "target": "self"
          }
        },
        "minecraft:behavior.follow_parent": {
          "priority": 8,
          "speed_multiplier": 1.10
        }
      },
      
      "component:warthog_wild": {
        "minecraft:rideable": {
          "seat_count": 1,
          "family_types": [
            "zombie"
          ],
          "seats": {
            "position": [ 0.0, 0.675, -0.1 ]
          }
        },
        "minecraft:on_target_acquired": {
          "event": "minecraft:become_angry",
          "target": "self"
        },
        
        "minecraft:behavior.avoid_mob_type": {
          "priority": 6,
          "remove_target": false,
          "avoid_target_xz": 16,
          "avoid_target_y": 7,
          "max_dist": 3.0,
          "max_flee": 10.0,
          "sprint_distance": 7.0,
          "sprint_speed_multiplier": 1.10,
          "walk_speed_multiplier": 1.10,
          "probability_per_strength": 0.14,
          "avoid_mob_sound": "retreat",
          "sound_interval": {
            "range_min": 2.0,
            "range_max": 5.0
          },
          "entity_types": [
            {
              "must_see": true,
              "reevaluate_description": false,
              "max_dist": 8,
              "walk_speed_multiplier": 1.10,
              "sprint_speed_multiplier": 1.10,
              "filters": {
                "any_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "illager",
                    "operator": "=="
                  }
                ]
              }
            }
          ]
        },
        "minecraft:behavior.tempt": {
          "priority": 7,
          "can_get_scared": false,
          "can_tempt_vertically": false,
          "can_tempt_while_ridden": false,
          "speed_multiplier": 0.80,
          "within_radius": 16,
          "items": [
            "minecraft:apple",
            "minecraft:beetroot",
            "minecraft:carrot",
            "minecraft:potato"
          ]
        }
      },
      "component:warthog_angry": {
        "minecraft:angry": {
          "duration": 25,
          "broadcast_anger": true,
          "broadcast_range": 20,
          "broadcast_targets": [
            "warthog"
          ],
          "angry_sound": "angry",
          "sound_interval": {
            "range_min": 2.0,
            "range_max": 5.0
          },
          "calm_event": {
            "event": "minecraft:on_calm",
            "target": "self"
          }
        }
      },
      "component:variant_00": {
        "minecraft:variant": {
          "value": 0
        }
      },
      "component:variant_01": {
        "minecraft:variant": {
          "value": 1
        }
      }
    },
    "components": {
      "minecraft:balloonable": {
        "mass": 1.0
      },
      "minecraft:can_climb": {},
      "minecraft:collision_box": {
        "width": 0.8,
        "height": 1.0
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:movement": {
        "value": 0.30
      },
      "minecraft:type_family": {
        "family": [
          "warthog",
          "mob"
        ]
      },
      
      "minecraft:attack": {
        "damage": [ 2, 3 ]
      },
      "minecraft:breathable": {
        "breathes_air": true,
        "breathes_lava": false,
        "breathes_solids": false,
        "breathes_water": false,
        "generates_bubbles": true,
        "inhale_time": 0,
        "suffocate_time": 0,
        "total_supply": 30
      },
      "minecraft:despawn": {
        "despawn_from_chance": true,
        "despawn_from_inactivity": true,
        "despawn_from_simulation_edge": true,
        "remove_child_entities": false,
        "min_range_inactivity_timer": 30,
        "min_range_random_chance": 800,
        "despawn_from_distance": {
          "max_distance": 128,
          "min_distance": 32
        }
      },
      "minecraft:healable": {
        "items": [
          {
            "item": "minecraft:apple",
            "heal_amount": 4
          },
          {
            "item": "minecraft:beetroot",
            "heal_amount": 1
          },
          {
            "item": "minecraft:carrot",
            "heal_amount": 3
          },
          {
            "item": "minecraft:potato",
            "heal_amount": 1
          }
        ]
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "cause": "lava",
            "damage_per_tick": 4,
            "filters": {
              "test": "in_lava",
              "subject": "self",
              "operator": "==",
              "value": true
            }
          }
        ]
      },
      "minecraft:jump.static": {
        "jump_power": 0.42
      },
      "minecraft:leashable": {
        "soft_distance": 4.0,
        "hard_distance": 6.0,
        "max_distance": 10.0
      },
      "minecraft:movement.basic": {
        "max_turn": 30.0
      },
      "minecraft:nameable": {
        "allow_name_tag_renaming": true,
        "always_show": false
      },
      "minecraft:navigation.walk": {
        "avoid_damage_blocks": true,
        "avoid_portals": false,
        "avoid_sun": false,
        "avoid_water": true,
        "can_breach": false,
        "can_break_doors": false,
        "can_jump": true,
        "can_open_doors": false,
        "can_open_iron_doors": false,
        "can_pass_doors": true,
        "can_path_from_air": false,
        "can_path_over_lava": false,
        "can_path_over_water": true,
        "can_sink": true,
        "can_swim": false,
        "can_walk": true,
        "can_walk_in_lava": false,
        "is_amphibious": false,
        "blocks_to_avoid": [
          {
            "tags": "query.any_tag('heated_netherrack_active')"
          },
          "minecraft:fire",
          "minecraft:flowing_lava",
          "minecraft:lava",
          "minecraft:magma",
          "minecraft:soul_fire"
        ]
      },
      "minecraft:physics": {
        "has_collision": true,
        "has_gravity": true
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.mount_pathing": {
        "priority": 1,
        "track_target": true,
        "speed_multiplier": 1.25,
        "target_dist": 0
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 3,
        "alert_same_type": false,
        "hurt_owner": false,
        "entity_types": [
          {
            "must_see": false,
            "reevaluate_description": false,
            "max_dist": 16,
            "walk_speed_multiplier": 1.10,
            "sprint_speed_multiplier": 1.10,
            "filters": {
              "any_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "creeper",
                  "operator": "!="
                }
              ]
            }
          }
        ]
      },
      "minecraft:behavior.leap_at_target": {
        "priority": 4,
        "target_dist": 0.4
      },
      "minecraft:behavior.melee_attack": {
        "priority": 5,
        "attack_once": false,
        "track_target": true,
        "require_complete_path": false,
        "cooldown_time": 1,
        "speed_multiplier": 1.10
      },
      "minecraft:behavior.random_stroll": {
        "priority": 9,
        "speed_multiplier": 1.0
      },
      "minecraft:behavior.look_at_player": {
        "priority": 10,
        "probability": 0.02,
        "angle_of_view_horizontal": 360,
        "angle_of_view_vertical": 360,
        "look_distance": 8.0,
        "look_time": [ 2, 4 ]
      },
      "minecraft:behavior.random_look_around": {
        "priority": 11,
        "look_time": [ 2, 4 ]
      },
      "minecraft:behavior.look_at_entity": {
        "priority": 12,
        "probability": 0.02,
        "angle_of_view_horizontal": 360,
        "angle_of_view_vertical": 360,
        "look_distance": 4.0,
        "look_time": [ 1, 2 ],
        "filters": {
          "any_of": [
            {
              "test": "is_family",
              "subject": "other",
              "value": "mob",
              "operator": "=="
            }
          ]
        }
      },
      "minecraft:conditional_bandwidth_optimization": {
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "weight": 100,
            "remove": {},
            "add": {
              "component_groups": [
                "component:warthog_adult",
                "component:warthog_wild",
                "component:variant_00"
              ]
            }
          },
          {
            "weight": 100,
            "remove": {},
            "add": {
              "component_groups": [
                "component:warthog_adult",
                "component:warthog_wild",
                "component:variant_01"
              ]
            }
          },
          {
            "weight": 10,
            "remove": {},
            "add": {
              "component_groups": [
                "component:warthog_baby",
                "component:warthog_wild",
                "component:variant_00"
              ]
            }
          },
          {
            "weight": 10,
            "remove": {},
            "add": {
              "component_groups": [
                "component:warthog_baby",
                "component:warthog_wild",
                "component:variant_01"
              ]
            }
          }
        ]
      },
      "minecraft:entity_born": {
        "sequence": [
          {
            "filters": {
              "test": "has_component",
              "value": "minecraft:is_baby",
              "operator": "!="
            },
            "remove": {
              "component_groups": [
                "component:warthog_adult"
              ]
            },
            "add": {
              "component_groups": [
                "component:warthog_baby"
              ]
            }
          }
        ]
      },
      "minecraft:ageable_grow_up": {
        "remove": {
          "component_groups": [
            "component:warthog_baby"
          ]
        },
        "add": {
          "component_groups": [
            "component:warthog_adult"
          ]
        }
      },
      "minecraft:become_angry": {
        "remove": {
          "component_groups": [
            "component:warthog_wild"
          ]
        },
        "add": {
          "component_groups": [
            "component:warthog_angry"
          ]
        }
      },
      "minecraft:on_calm": {
        "remove": {
          "component_groups": [
            "component:warthog_angry"
          ]
        },
        "add": {
          "component_groups": [
            "component:warthog_wild"
          ]
        }
      }
    }
  }
}
