{
  "format_version": "1.21.50",
  "minecraft:entity": {
    "description": {
      "name": "Kangaroo",
      "identifier": "silverlabs_nat:kangaroo",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "properties": {
        "silverlabs_nat:has_baby_in_pouch": {
          "type": "bool",
          "default": false,
          "client_sync": true
        },
        "silverlabs_nat:is_following_owner": {
          "type": "bool",
          "default": true,
          "client_sync": false
        }
      }
    },
    "component_groups": {
      "silverlabs_nat:despawn": {
        "minecraft:instant_despawn": {}
      },
      "silverlabs_nat:baby_hitbox": {
        "minecraft:collision_box": {
          "width": 0.5,
          "height": 1.05
        }
      },
      "silverlabs_nat:baby": {
        "minecraft:type_family": {
          "family": [
            "silverlabs_nat:baby_kangaroo_untamed",
            "silverlabs_nat:baby",
            "mob"
          ]
        },
        "minecraft:is_baby": {},
        "minecraft:collision_box": {
          "width": 0.5,
          "height": 1.05
        },
        "minecraft:tameable": {
          "probability": 1,
          "tame_items": [
            "wheat"
          ],
          "tame_event": {
            "event": "silverlabs_nat:kangaroo_tamed",
            "target": "self"
          }
        },
        "minecraft:ageable": {
          "duration": 1200,
          "feed_items": [
            "wheat"
          ],
          "grow_up": {
            "filters": {
              "test": "is_riding",
              "value": false
            },
            "event": "silverlabs_nat:kangaroo_grow_up",
            "target": "self"
          }
        },
        "minecraft:behavior.follow_parent": {
          "priority": 6,
          "speed_multiplier": 1.1
        },
        "minecraft:environment_sensor": {
          "triggers": [
            {
              "filters": {
                "test": "is_riding"
              },
              "event": "silverlabs_nat:kangaroo_baby_on_pouch",
              "target": "self"
            },
            {
              "filters": {
                "operator": "!=",
                "test": "is_riding"
              },
              "event": "silverlabs_nat:kangaroo_baby_out_of_pouch",
              "target": "self"
            }
          ]
        },
        "minecraft:behavior.move_to_block": {
          "priority": 8,
          "start_chance": 0.2,
          "search_range": 32,
          "goal_radius": 0.25,
          "stay_duration": 3,
          "target_selection_method": "random",
          "on_reach": {
            "event": "silverlabs_nat:start_sniff",
            "target": "self"
          },
          "target_blocks": [
            "minecraft:poppy",
            "minecraft:dandelion",
            "minecraft:blue_orchid",
            "minecraft:allium",
            "minecraft:azure_bluet",
            "minecraft:orange_tulip",
            "minecraft:pink_tulip",
            "minecraft:red_tulip",
            "minecraft:white_tulip",
            "minecraft:oxeye_daisy",
            "minecraft:cornflower",
            "minecraft:lily_of_the_valley",
            "minecraft:sunflower",
            "minecraft:lilac",
            "minecraft:rose_bush",
            "minecraft:peony",
            "minecraft:pitcher_plant",
            "minecraft:pink_petals",
            "minecraft:wildflowers",
            "minecraft:torchflower",
            "minecraft:closed_eyeblossom",
            "minecraft:open_eyeblossom"
          ]
        },
        "minecraft:behavior.follow_mob": {
          "priority": 6,
          "search_range": 16,
          "stop_distance": 5,
          "speed_multiplier": 1.1,
          "use_home_position_restriction": true,
          "filters": {
            "all_of": [
              {
                "test": "is_underwater",
                "subject": "other",
                "value": false
              },
              {
                "test": "is_baby",
                "subject": "other",
                "value": false
              },
              {
                "any_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "silverlabs_nat:butterfly"
                  },
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "butterfly"
                  }
                ]
              }
            ]
          }
        },
        "minecraft:interact": {
          "interactions": [
            {
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "test": "is_baby",
                      "subject": "self",
                      "value": false
                    },
                    {
                      "test": "has_equipment",
                      "subject": "other",
                      "domain": "hand",
                      "value": "silverlabs_nat:pacifier"
                    }
                  ]
                },
                "event": "silverlabs_nat:revert_to_baby"
              },
              "use_item": false,
              "swing": true
            },
            {
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "test": "has_equipment",
                      "subject": "other",
                      "domain": "hand",
                      "value": "silverlabs_nat:empty_knapsack"
                    }
                  ]
                },
                "event": "silverlabs_nat:knapsack_swing"
              },
              "swing": true
            },
            {
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "test": "has_component",
                      "value": "minecraft:is_tamed"
                    },
                    {
                      "test": "is_sitting",
                      "operator": "!="
                    },
                    {
                      "test": "is_sneaking",
                      "subject": "other",
                      "operator": "!="
                    }
                  ],
                  "any_of": [
                    {
                      "test": "has_equipment",
                      "value": "silverlabs_nat:whistle",
                      "subject": "other"
                    },
                    {
                      "test": "has_equipment",
                      "value": "sf_hba:whistle",
                      "subject": "other"
                    }
                  ]
                }
              },
              "swing": true
            }
          ]
        }
      },
      "silverlabs_nat:adult_hitbox": {
        "minecraft:collision_box": {
          "width": 1,
          "height": 2.1
        }
      },
      "silverlabs_nat:adult": {
        "minecraft:type_family": {
          "family": [
            "silverlabs_nat:kangaroo"
          ]
        },
        "minecraft:rideable": {
          "family_types": [
            "silverlabs_nat:baby_kangaroo_untamed"
          ],
          "pull_in_entities": true,
          "rider_can_interact": false,
          "seat_count": 1,
          "seats": [
            {
              "lock_rider_rotation": 0,
              "position": [
                0,
                0.3,
                0
              ]
            }
          ]
        },
        "minecraft:entity_sensor": {
          "relative_range": true,
          "subsensors": [
            {
              "cooldown": 1,
              "range": [
                1,
                1
              ],
              "event_filters": [
                {
                  "test": "rider_count",
                  "value": 0
                },
                {
                  "test": "has_component",
                  "value": "minecraft:is_baby",
                  "subject": "other"
                },
                {
                  "test": "is_family",
                  "value": "silverlabs_nat:kangaroo",
                  "subject": "other"
                },
                {
                  "test": "has_component",
                  "value": "minecraft:is_tamed",
                  "subject": "other",
                  "operator": "!="
                },
                {
                  "test": "is_riding",
                  "subject": "other",
                  "operator": "!="
                }
              ],
              "event": "silverlabs_nat:scoop_up_baby"
            }
          ]
        },
        "minecraft:experience_reward": {
          "on_death": "q.last_hit_by_player ? 3: 0",
          "on_bred": "Math.random(1,7)"
        },
        "minecraft:loot": {
          "table": "loot_tables/sf/nba/entities/kangaroo.loot.json"
        },
        "minecraft:behavior.breed": {
          "priority": 1,
          "speed_multiplier": 1
        },
        "minecraft:breedable": {
          "require_tame": false,
          "inherit_tamed": true,
          "breeds_with": {
            "mate_type": "silverlabs_nat:kangaroo",
            "baby_type": "silverlabs_nat:kangaroo",
            "breed_event": {
              "event": "silverlabs_nat:baby",
              "target": "baby"
            }
          },
          "breed_items": [
            "wheat"
          ]
        },
        "minecraft:interact": {
          "interactions": [
            {
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "test": "is_baby",
                      "subject": "self",
                      "value": false
                    },
                    {
                      "test": "has_equipment",
                      "subject": "other",
                      "domain": "hand",
                      "value": "silverlabs_nat:pacifier"
                    }
                  ]
                },
                "event": "silverlabs_nat:revert_to_baby"
              },
              "use_item": false,
              "swing": true
            },
            {
              "on_interact": {
                "filters": {
                  "all_of": [
                    {
                      "test": "has_component",
                      "value": "minecraft:is_tamed"
                    },
                    {
                      "test": "is_sitting",
                      "operator": "!="
                    },
                    {
                      "test": "is_sneaking",
                      "subject": "other",
                      "operator": "!="
                    }
                  ],
                  "any_of": [
                    {
                      "test": "has_equipment",
                      "value": "silverlabs_nat:whistle",
                      "subject": "other"
                    },
                    {
                      "test": "has_equipment",
                      "value": "sf_hba:whistle",
                      "subject": "other"
                    }
                  ]
                }
              },
              "swing": true
            }
          ]
        }
      },
      "silverlabs_nat:with_boxing_gloves": {
        "minecraft:mark_variant": {
          "value": 1
        }
      },
      "silverlabs_nat:with_baby_in_pouch": {
        "minecraft:addrider": {
          "entity_type": "silverlabs_nat:kangaroo",
          "spawn_event": "silverlabs_nat:baby"
        }
      },
      "silverlabs_nat:with_baby_in_pouch_with_boxing_gloves": {
        "minecraft:addrider": {
          "entity_type": "silverlabs_nat:kangaroo",
          "spawn_event": "silverlabs_nat:kangaroo_as_baby_with_boxing_gloves"
        }
      },
      "silverlabs_nat:natural_despawn": {
        "minecraft:despawn": {
          "despawn_from_distance": {},
          "remove_child_entities": true
        }
      },
      "silverlabs_nat:persistent": {
        "minecraft:persistent": {}
      },
      "silverlabs_nat:follow_owner": {
        "minecraft:behavior.follow_owner": {
          "priority": 7,
          "speed_multiplier": 1.2,
          "start_distance": 10,
          "stop_distance": 3
        },
        "minecraft:behavior.random_stroll": {
          "priority": 8
        }
      },
      "silverlabs_nat:wander_around": {
        "minecraft:behavior.random_stroll": {
          "priority": 8
        }
      },
      "silverlabs_nat:kangaroo_tamed": {
        "minecraft:is_tamed": {},
        "minecraft:healable": {
          "items": [
            {
              "item": "wheat",
              "heal_amount": 2
            }
          ]
        }
      },
      "silverlabs_nat:baby_kangaroo_tamed": {
        "minecraft:sittable": {},
        "minecraft:behavior.stay_while_sitting": {
          "priority": 0
        },
        "minecraft:type_family": {
          "family": [
            "silverlabs_nat:baby_kangaroo_tamed",
            "silverlabs_nat:kangaroo",
            "mob"
          ]
        }
      }
    },
    "components": {
      "minecraft:nameable": {},
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:behavior.tempt": {
        "priority": 3,
        "speed_multiplier": 1.2,
        "items": [
          "wheat"
        ]
      },
      "minecraft:collision_box": {
        "width": 1,
        "height": 2.1
      },
      "minecraft:movement.basic": {},
      "minecraft:movement": {
        "value": 0.25
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 2,
        "reselect_targets": true,
        "must_see": true,
        "entity_types": [
          {
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    {
                      "test": "is_family",
                      "subject": "other",
                      "value": "player"
                    },
                    {
                      "test": "is_family",
                      "subject": "other",
                      "value": "monster"
                    }
                  ]
                },
                {
                  "test": "rider_count",
                  "value": 1
                }
              ]
            },
            "max_dist": 16,
            "must_see": true
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_family",
                  "subject": "other",
                  "value": "player"
                },
                {
                  "test": "is_mark_variant",
                  "value": 1
                }
              ]
            },
            "max_dist": 20,
            "walk_speed_multiplier": 1.5,
            "must_see": true
          }
        ]
      },
      "minecraft:behavior.delayed_attack": {
        "priority": 2,
        "attack_duration": 0.5,
        "attack_once": false,
        "hit_delay_pct": 0.66,
        "random_stop_interval": 0,
        "reach_multiplier": 1.5,
        "cooldown_time": 5,
        "require_complete_path": true,
        "track_target": true
      },
      "minecraft:behavior.random_stroll": {
        "priority": 4
      },
      "minecraft:behavior.random_look_around": {
        "priority": 5,
        "look_distance": 1.5
      },
      "minecraft:navigation.walk": {
        "is_amphibious": false,
        "avoid_sun": false,
        "avoid_water": true,
        "can_path_over_water": false
      },
      "minecraft:jump.static": {},
      "minecraft:can_climb": {},
      "minecraft:health": {
        "value": 12,
        "max": 12
      },
      "minecraft:healable": {
        "items": [
          {
            "item": "wheat",
            "heal_amount": 2
          }
        ]
      },
      "minecraft:leashable": {
        "soft_distance": 4,
        "hard_distance": 6,
        "max_distance": 10
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:attack": {
        "damage": 4
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:interact": {
        "interactions": [
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "is_baby",
                    "subject": "self",
                    "value": true
                  },
                  {
                    "test": "has_equipment",
                    "subject": "other",
                    "domain": "hand",
                    "value": "silverlabs_nat:empty_knapsack"
                  }
                ]
              },
              "event": "silverlabs_nat:knapsack_swing"
            },
            "swing": true
          },
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "has_equipment",
                    "subject": "other",
                    "domain": "hand",
                    "value": "silverlabs_nat:pacifier"
                  }
                ]
              },
              "event": "silverlabs_nat:revert_to_baby"
            },
            "use_item": false,
            "swing": true
          },
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "has_equipment",
                    "subject": "other",
                    "domain": "hand",
                    "value": "silverlabs_nat:empty_knapsack"
                  }
                ]
              },
              "event": "silverlabs_nat:knapsack_no_capture"
            },
            "swing": false
          },
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "has_component",
                    "value": "minecraft:is_tamed"
                  },
                  {
                    "test": "is_sitting",
                    "operator": "!="
                  },
                  {
                    "test": "is_sneaking",
                    "subject": "other",
                    "operator": "!="
                  }
                ],
                "any_of": [
                  {
                    "test": "has_equipment",
                    "value": "silverlabs_nat:whistle",
                    "subject": "other"
                  },
                  {
                    "test": "has_equipment",
                    "value": "sf_hba:whistle",
                    "subject": "other"
                  }
                ]
              }
            },
            "swing": true
          }
        ]
      }
    },
    "events": {
      "minecraft:entity_spawned": {
        "randomize": [
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:adult"
              ]
            },
            "weight": 80
          },
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:adult",
                "silverlabs_nat:with_baby_in_pouch"
              ]
            },
            "weight": 8
          },
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:baby"
              ]
            },
            "weight": 7
          },
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:adult",
                "silverlabs_nat:with_boxing_gloves"
              ]
            },
            "weight": 4
          },
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:adult",
                "silverlabs_nat:with_baby_in_pouch_with_boxing_gloves"
              ]
            },
            "weight": 1
          }
        ]
      },
      "silverlabs_nat:despawn": {
        "add": {
          "component_groups": [
            "silverlabs_nat:despawn"
          ]
        }
      },
      "silverlabs_nat:baby": {
        "add": {
          "component_groups": [
            "silverlabs_nat:baby"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:adult"
          ]
        }
      },
      "silverlabs_nat:kangaroo_as_baby_with_boxing_gloves": {
        "trigger": "silverlabs_nat:baby",
        "add": {
          "component_groups": [
            "silverlabs_nat:with_boxing_gloves"
          ]
        }
      },
      "silverlabs_nat:adult": {
        "add": {
          "component_groups": [
            "silverlabs_nat:adult"
          ]
        }
      },
      "silverlabs_nat:kangaroo_grow_up": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:baby",
            "silverlabs_nat:baby_kangaroo_tamed"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:adult",
            "silverlabs_nat:adult_hitbox"
          ]
        },
        "queue_command": {
          "command": [
            "ride @s stop_riding"
          ]
        }
      },
      "silverlabs_nat:kangaroo_baby_on_pouch": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:baby_hitbox"
          ]
        },
        "queue_command": {
          "command": [
            "effect @s invisibility infinite 1 true"
          ]
        }
      },
      "silverlabs_nat:kangaroo_baby_out_of_pouch": {
        "add": {
          "component_groups": [
            "silverlabs_nat:baby_hitbox"
          ]
        },
        "queue_command": {
          "command": [
            "effect @s clear"
          ]
        }
      },
      "silverlabs_nat:natural_despawn": {
        "add": {
          "component_groups": [
            "silverlabs_nat:natural_despawn"
          ]
        }
      },
      "silverlabs_nat:become_persistent": {
        "add": {
          "component_groups": [
            "silverlabs_nat:persistent"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:natural_despawn"
          ]
        }
      },
      "silverlabs_nat:set_permanent_baby": {
        "add": {
          "component_groups": [
            "silverlabs_nat:permanent_baby"
          ]
        },
        "queue_command": {
          "command": [
            "particle minecraft:villager_angry ~ ~2 ~",
            "playsound random.eat @p ~ ~ ~ 0.8 1.2"
          ]
        }
      },
      "silverlabs_nat:kangaroo_tamed": {
        "add": {
          "component_groups": [
            "silverlabs_nat:kangaroo_tamed",
            "silverlabs_nat:baby_kangaroo_tamed",
            "silverlabs_nat:follow_owner"
          ]
        }
      },
      "silverlabs_nat:start_sniff": {
        "queue_command": {
          "command": [
            "playsound silverlabs_nat.flower_obsession.baby_sniff_medium @a[r=6]"
          ]
        }
      },
      "silverlabs_nat:revert_to_baby": {
        "add": {
          "component_groups": [
            "silverlabs_nat:baby"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:adult"
          ]
        }
      },
      "silverlabs_nat:follow_owner": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:wander_around"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:follow_owner"
          ]
        },
        "set_property": {
          "silverlabs_nat:is_following_owner": true
        },
        "queue_command": {
          "command": [
            "title @s actionbar Following",
            "playsound silverlabs_nat.whistle.whistle @a[r=8] ~~~"
          ],
          "target": "other"
        }
      },
      "silverlabs_nat:wander_around": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:follow_owner"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:wander_around"
          ]
        },
        "set_property": {
          "silverlabs_nat:is_following_owner": false
        },
        "queue_command": {
          "command": [
            "title @s actionbar Wandering",
            "playsound silverlabs_nat.whistle.whistle @a[r=8] ~~~"
          ],
          "target": "other"
        }
      },
      "silverlabs_nat:knapsack_no_capture": {}
    }
  }
}