{
  "format_version": "1.17.20",
  "minecraft:entity": {
    "description": {
      "identifier": "nicothekid:squirrel",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false
    },
    "component_groups": {
      "component:squirrel_wild": {
        "minecraft:equip_item": {},
        "minecraft:health": {
          "value": 6,
          "max": 6
        },
        "minecraft:type_family": {
          "family": [
            "squirrel",
            "lightweight",
            "mob"
          ]
        },
        "minecraft:variant": {
          "value": 0
        },

        "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: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": [
            "minecraft:cactus",
            "minecraft:fire",
            "minecraft:flowing_lava",
            "minecraft:lava",
            "minecraft:magma",
            "minecraft:soul_fire"
          ]
        },
        "minecraft:shareables": {
          "all_items": false,
          "all_items_max_amount": 1,
          "items": [
            {
              "item": "nicothekid:moss_berry",
              "max_amount": 1,
              "priority": 0
            },
            {
              "item": "nicothekid:pumpkin_slice",
              "max_amount": 1,
              "priority": 0
            },
            {
              "item": "minecraft:apple",
              "max_amount": 1,
              "priority": 0
            },
            {
              "item": "minecraft:beetroot",
              "max_amount": 1,
              "priority": 0
            },
            {
              "item": "minecraft:carrot",
              "max_amount": 1,
              "priority": 0
            },
            {
              "item": "minecraft:glow_berries",
              "max_amount": 1,
              "priority": 0
            },
            {
              "item": "minecraft:melon",
              "max_amount": 1,
              "priority": 0
            },
            {
              "item": "minecraft:sweet_berries",
              "max_amount": 1,
              "priority": 0
            }
          ]
        },
        
        "minecraft:behavior.equip_item": {
          "priority": 2
        },
        "minecraft:behavior.tempt": {
          "priority": 5,
          "can_get_scared": true,
          "can_tempt_vertically": false,
          "can_tempt_while_ridden": false,
          "speed_multiplier": 0.80,
          "within_radius": 16,
          "items": [
            {
              "tags": "query.any_tag('moss_berry')"
            },
            {
              "tags": "query.any_tag('pumpkin_slice')"
            },
            "minecraft:apple",
            "minecraft:beetroot",
            "minecraft:carrot",
            "minecraft:glow_berries",
            "minecraft:melon",
            "minecraft:sweet_berries"
          ]
        },
        "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,
          "entity_types": [
            {
              "must_see": true,
              "reevaluate_description": false,
              "max_dist": 12,
              "walk_speed_multiplier": 1.10,
              "sprint_speed_multiplier": 1.10,
              "filters": {
                "any_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "player",
                    "operator": "=="
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "cave_wolf",
                    "operator": "=="
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "deopard",
                    "operator": "=="
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "monster",
                    "operator": "=="
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "ocelot",
                    "operator": "=="
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "raven",
                    "operator": "=="
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "wolf",
                    "operator": "=="
                  }
                ]
              }
            }
          ]
        },
        "minecraft:behavior.pickup_items": {
          "priority": 7,
          "max_dist": 3,
          "goal_radius": 2,
          "speed_multiplier": 0.9,
          "cooldown_after_being_attacked": 20.0,
          "can_pickup_any_item": false,
          "can_pickup_to_hand_or_equipment": true,
          "pickup_based_on_chance": true,
          "track_target": false
        },
        "minecraft:behavior.eat_carried_item": {
          "priority": 8,
          "delay_before_eating": 28
        },
        "minecraft:behavior.beg": {
          "priority": 9,
          "look_distance": 8,
          "look_time": [ 2, 4 ],
          "items": [
            "minecraft:apple"
           ]
        },
        "minecraft:behavior.eat_block": {
          "priority": 11,
          "time_until_eat": 1.5,
          "success_chance": 0.02,
          "eat_and_replace_block_pairs": [
            {
              "eat_block": "minecraft:farmland",
              "replace_block": "minecraft:dirt"
            },
            {
              "eat_block": "minecraft:beetroot",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:carrots",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:cave_vines_body_with_berries",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:cave_vines_head_with_berries",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:melon_block",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:potatoes",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:pumpkin",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:reeds",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:sweet_berry_bush",
              "replace_block": "minecraft:air"
            },
            {
              "eat_block": "minecraft:wheat",
              "replace_block": "minecraft:air"
            }
          ]
        }
      },
      "component:squirrel_tameable": {
        "minecraft:tameable": {
          "probability": 0.35,
          "tame_items": [
            "minecraft:apple"
          ],
          "tame_event": {
            "event": "minecraft:on_tame",
            "target": "self"
          }
        }
      },
      
      "component:squirrel_tamed": {
        "minecraft:health": {
          "value": 20,
          "max": 20
        },
        "minecraft:is_tamed": {},
        "minecraft:type_family": {
          "family": [
            "squirrel",
            "player_tamed",
            "lightweight",
            "mob"
          ]
        },
        "minecraft:variant": {
          "value": 1
        },

        "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:cactus",
            "minecraft:fire",
            "minecraft:flowing_lava",
            "minecraft:lava",
            "minecraft:magma",
            "minecraft:soul_fire",
            "minecraft:web"
          ]
        },
        "minecraft:persistent": {},
        "minecraft:sittable": {
          "sit_event": {
            "event": "minecraft:on_sit",
            "target": "self"
          },
          "stand_event": {
            "event": "minecraft:on_stand",
            "target": "self"
          }
        },
        
        "minecraft:behavior.stay_while_sitting": {
          "priority": 4
        },
        "minecraft:behavior.tempt": {
          "priority": 5,
          "can_get_scared": false,
          "can_tempt_vertically": true,
          "can_tempt_while_ridden": false,
          "speed_multiplier": 1.10,
          "within_radius": 16,
          "items": [
            {
              "tags": "query.any_tag('moss_berry')"
            },
            {
              "tags": "query.any_tag('pumpkin_slice')"
            },
            "minecraft:apple",
            "minecraft:beetroot",
            "minecraft:carrot",
            "minecraft:glow_berries",
            "minecraft:melon",
            "minecraft:sweet_berries"
          ]
        },
        "minecraft:behavior.follow_owner": {
          "priority": 5,
          "can_teleport": true,
          "ignore_vibration": true,
          "max_distance": 60.0,
          "start_distance": 12.0,
          "stop_distance": 4.0,
          "speed_multiplier": 1.10
        },
        "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,
          "entity_types": [
            {
              "must_see": true,
              "reevaluate_description": false,
              "max_dist": 12,
              "walk_speed_multiplier": 1.10,
              "sprint_speed_multiplier": 1.10,
              "filters": {
                "any_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "monster",
                    "operator": "=="
                  }
                ]
              }
            }
          ]
        },
        "minecraft:behavior.beg": {
          "priority": 9,
          "look_distance": 8,
          "look_time": [ 2, 4 ],
          "items": [
            {
              "tags": "query.any_tag('moss_berry')"
            },
            {
              "tags": "query.any_tag('pumpkin_slice')"
            },
            "minecraft:apple",
            "minecraft:beetroot",
            "minecraft:carrot",
            "minecraft:glow_berries",
            "minecraft:melon",
            "minecraft:sweet_berries"
          ]
        }
      },
      "component:squirrel_adult": {
        "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_squirrel.json"
        },
        "minecraft:scale": {
          "value": 0.6
        },
        
        "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": [
            {
              "tags": "query.any_tag('moss_berry')"
            },
            {
              "tags": "query.any_tag('pumpkin_slice')"
            },
            "minecraft:beetroot",
            "minecraft:carrot",
            "minecraft:glow_berries",
            "minecraft:melon",
            "minecraft:sweet_berries"
          ],
          "breeds_with": {
            "mate_type": "nicothekid:squirrel",
            "baby_type": "nicothekid:squirrel",
            "breed_event": {
              "event": "minecraft:entity_born",
              "target": "baby"
            }
          }
        },
        "minecraft:behavior.breed": {
          "priority": 3,
          "speed_multiplier": 1.0
        }
      },
      
      "component:squirrel_baby_wild": {
        "minecraft:is_baby": {},
        "minecraft:scale": {
          "value": 0.4
        },

        "minecraft:ageable": {
          "duration": 1500,
          "feed_items": [
            {
              "item": {
                "tags": "query.any_tag('moss_berry')"
              },
              "growth": 0.15
            },
            {
              "item": {
                "tags": "query.any_tag('pumpkin_slice')"
              },
              "growth": 0.15
            },
            {
              "item": "minecraft:apple",
              "growth": 0.25
            },
            {
              "item": "minecraft:beetroot",
              "growth": 0.15
            },
            {
              "item": "minecraft:carrot",
              "growth": 0.15
            },
            {
              "item": "minecraft:glow_berries",
              "growth": 0.15
            },
            {
              "item": "minecraft:apple",
              "growth": 0.15
            },
            {
              "item": "minecraft:melon",
              "growth": 0.15
            },
            {
              "item": "minecraft:sweet_berries",
              "growth": 0.15
            }
          ],
          "grow_up": {
            "event": "minecraft:ageable_grow_up_wild",
            "target": "self"
          }
        },
        "minecraft:behavior.follow_parent": {
          "priority": 5,
          "speed_multiplier": 1.10
        }
      },
      "component:squirrel_baby_tamed": {
        "minecraft:is_baby": {},
        "minecraft:scale": {
          "value": 0.4
        },

        "minecraft:ageable": {
          "duration": 2000,
          "feed_items": [
            {
              "item": {
                "tags": "query.any_tag('moss_berry')"
              },
              "growth": 0.15
            },
            {
              "item": {
                "tags": "query.any_tag('pumpkin_slice')"
              },
              "growth": 0.15
            },
            {
              "item": "minecraft:apple",
              "growth": 0.25
            },
            {
              "item": "minecraft:beetroot",
              "growth": 0.15
            },
            {
              "item": "minecraft:carrot",
              "growth": 0.15
            },
            {
              "item": "minecraft:glow_berries",
              "growth": 0.15
            },
            {
              "item": "minecraft:apple",
              "growth": 0.15
            },
            {
              "item": "minecraft:melon",
              "growth": 0.15
            },
            {
              "item": "minecraft:sweet_berries",
              "growth": 0.15
            }
          ],
          "grow_up": {
            "event": "minecraft:ageable_grow_up_tamed",
            "target": "self"
          }
        }
      }
    },
    "components": {
      "minecraft:balloonable": {
        "mass": 0.4
      },
      "minecraft:can_climb": {},
      "minecraft:collision_box": {
        "width": 0.5,
        "height": 0.7
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:movement": {
        "value": 0.30
      },
      
      "minecraft:block_climber": {},
      "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": 15
      },
      "minecraft:healable": {
        "items": [
          {
            "item": {
              "tags": "query.any_tag('moss_berry')"
            },
            "heal_amount": 2
          },
          {
            "item": {
              "tags": "query.any_tag('pumpkin_slice')"
            },
            "heal_amount": 2
          },
          {
            "item": "minecraft:apple",
            "heal_amount": 4
          },
          {
            "item": "minecraft:beetroot",
            "heal_amount": 1
          },
          {
            "item": "minecraft:carrot",
            "heal_amount": 3
          },
          {
            "item": "minecraft:glow_berries",
            "heal_amount": 2
          },
          {
            "item": "minecraft:melon",
            "heal_amount": 2
          },
          {
            "item": "minecraft:sweet_berries",
            "heal_amount": 2
          }
        ]
      },
      "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:physics": {
        "has_collision": true,
        "has_gravity": true
      },
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.panic" : {
        "priority": 1,
        "force": false,
        "ignore_mob_damage": false,
        "prefer_water": false,
        "speed_multiplier": 1.25
      },
      "minecraft:behavior.random_stroll": {
        "priority": 13,
        "speed_multiplier": 1.30
      },
      "minecraft:behavior.look_at_player": {
        "priority": 14,
        "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": 15,
        "look_time": [ 2, 4 ]
      },
      
      "minecraft:conditional_bandwidth_optimization": {
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "sequence": [
          {
            "randomize": [
              {
                "weight": 100,
                "add": {
                  "component_groups": [
                    "component:squirrel_adult",
                    "component:squirrel_wild",
                    "component:squirrel_tameable"
                  ]
                }
              },
              {
                "weight": 25,
                "add": {
                  "component_groups": [
                    "component:squirrel_baby_wild",
                    "component:squirrel_wild"
                  ]
                }
              }
            ]
          }
        ]
      },
      "minecraft:entity_born": {
        "sequence": [
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_component",
                  "subject": "parent",
                  "value": "minecraft:is_tamed",
                  "operator": "!="
                }
              ]
            },
            "remove": {
              "component_groups": [
                "component:squirrel_baby_tamed",
                "component:squirrel_tamed"
              ]
            },
            "add": {
              "component_groups": [
                "component:squirrel_baby_wild",
                "component:squirrel_wild"
              ]
            }
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "has_component",
                  "subject": "parent",
                  "value": "minecraft:is_tamed",
                  "operator": "=="
                }
              ]
            },
            "remove": {
              "component_groups": [
                "component:squirrel_baby_wild",
                "component:squirrel_wild"
              ]
            },
            "add": {
              "component_groups": [
                "component:squirrel_baby_tamed",
                "component:squirrel_tamed"
              ]
            }
          }
        ]
      },
      "minecraft:ageable_grow_up_wild": {
        "remove": {
          "component_groups": [
            "component:squirrel_baby_wild"
          ]
        },
        "add": {
          "component_groups": [
            "component:squirrel_adult",
            "component:squirrel_tameable"
          ]
        }
      },
      "minecraft:ageable_grow_up_tamed": {
        "remove": {
          "component_groups": [
            "component:squirrel_baby_tamed"
          ]
        },
        "add": {
          "component_groups": [
            "component:squirrel_adult",
            "component:squirrel_tamed"
          ]
        }
      },
      "minecraft:on_tame": {
        "remove": {
          "component_groups": [
            "component:squirrel_tameable",
            "component:squirrel_wild"
          ]
        },
        "add": {
          "component_groups": [
            "component:squirrel_tamed"
          ]
        }
      },
      "minecraft:on_sit": {},
      "minecraft:on_stand": {}
    }
  }
}