{
  "format_version": "1.21.50",
  "minecraft:entity": {
    "description": {
      "identifier": "silverlabs_nat:owl",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "properties": {
        "silverlabs_nat:is_following_owner": {
          "type": "bool",
          "default": true,
          "client_sync": false
        },
        "silverlabs_nat:movement_mode": {
          "type": "enum",
          "values": [
            "walk",
            "fly"
          ],
          "default": "walk"
        },
        "silverlabs_nat:is_tempted": {
          "type": "bool",
          "default": false
        },
        "silverlabs_nat:variant": {
          "type": "int",
          "default": "q.had_component_group('silverlabs_nat:spawn_snowy') ? 1: 0",
          "range": [
            0,
            1
          ],
          "client_sync": true
        }
      },
      "scripts": {
        "animate": [
          "landing_check",
          "tempt_check",
          "smooth_landing"
        ]
      },
      "animations": {
        "landing_check": "controller.animation.silverlabs_nat.bird.landing_check",
        "tempt_check": "controller.animation.silverlabs_nat.bird.tempt_check",
        "smooth_landing": "controller.animation.silverlabs_nat.bird.smooth_landing"
      }
    },
    "component_groups": {
      "silverlabs_nat:baby": {
        "minecraft:is_baby": {},
        "minecraft:behavior.hurt_by_target": {
          "priority": 1
        },
        "minecraft:behavior.panic": {
          "priority": 2,
          "speed_multiplier": 1.2
        },
        "minecraft:movement": {
          "value": 0.12
        },
        "minecraft:collision_box": {
          "width": 0.4,
          "height": 0.4
        },
        "minecraft:ageable": {
          "duration": 1200,
          "feed_items": [
            "rabbit",
            "cooked_rabbit",
            "silverlabs_nat:frog_leg",
            "silverlabs_nat:cooked_frog_leg"
          ],
          "grow_up": {
            "event": "silverlabs_nat:ageable_grow_up",
            "target": "self"
          }
        }
      },
      "silverlabs_nat:adult": {},
      "silverlabs_nat:adult_hitbox": {
        "minecraft:collision_box": {
          "width": 0.5,
          "height": 0.6
        }
      },
      "silverlabs_nat:owl_untamed": {
        "minecraft:tameable": {
          "probability": 1,
          "tame_items": [
            "rabbit",
            "cooked_rabbit",
            "silverlabs_nat:frog_leg",
            "silverlabs_nat:cooked_frog_leg"
          ],
          "tame_event": {
            "event": "silverlabs_nat:owl_tamed",
            "target": "self"
          }
        }
      },
      "silverlabs_nat:owl_tamed": {
        "minecraft:is_tamed": {},
        "minecraft:healable": {
          "items": [
            {
              "item": "rabbit",
              "heal_amount": 2
            },
            {
              "item": "cooked_rabbit",
              "heal_amount": 3
            },
            {
              "item": "silverlabs_nat:frog_leg",
              "heal_amount": 2
            },
            {
              "item": "silverlabs_nat:cooked_frog_leg",
              "heal_amount": 3
            }
          ]
        },
        "minecraft:sittable": {},
        "minecraft:behavior.stay_while_sitting": {
          "priority": 0
        }
      },
      "silverlabs_nat:bird_flying_mode": {
        "minecraft:physics": {
          "has_gravity": false
        },
        "minecraft:can_fly": {},
        "minecraft:movement.hover": {},
        "minecraft:navigation.hover": {
          "can_path_over_water": true,
          "can_sink": false,
          "can_pass_doors": false,
          "can_path_from_air": true,
          "avoid_water": true,
          "avoid_damage_blocks": true,
          "avoid_sun": false
        }
      },
      "silverlabs_nat:bird_walking_mode": {
        "minecraft:physics": {
          "has_gravity": true
        },
        "minecraft:navigation.walk": {
          "can_path_over_water": true,
          "avoid_water": true,
          "avoid_damage_blocks": true
        },
        "minecraft:movement.basic": {},
        "minecraft:jump.static": {},
        "minecraft:behavior.nap": {
          "priority": 1,
          "cooldown_min": 2,
          "cooldown_max": 4,
          "can_nap_filters": {
            "all_of": [
              {
                "test": "is_daytime",
                "operator": "==",
                "value": true
              },
              {
                "test": "in_block",
                "operator": "!=",
                "value": "water"
              },
              {
                "test": "on_ground",
                "operator": "==",
                "value": true
              }
            ]
          }
        }
      },
      "silverlabs_nat:follow_owner": {
        "minecraft:behavior.follow_owner": {
          "priority": 1,
          "speed_multiplier": 1.6,
          "start_distance": 12,
          "stop_distance": 4
        }
      },
      "silverlabs_nat:wander_around_walk": {
        "minecraft:behavior.random_stroll": {
          "priority": 3,
          "speed_multiplier": 0,
          "interval": 120,
          "xz_dist": 10,
          "y_dist": 7
        }
      },
      "silverlabs_nat:wander_around_fly": {
        "minecraft:behavior.random_hover": {
          "priority": 4,
          "xz_dist": 10,
          "y_dist": 8,
          "y_offset": -1,
          "interval": 2,
          "hover_height": [
            1,
            5
          ]
        },
        "minecraft:behavior.move_to_block": {
          "priority": 9,
          "tick_interval": 300,
          "start_chance": 1,
          "search_range": 32,
          "goal_radius": 1,
          "stay_duration": 2,
          "target_blocks": [
            "minecraft:leaves",
            "minecraft:leaves:1",
            "minecraft:leaves:2",
            "minecraft:leaves:3",
            "minecraft:leaves2",
            "minecraft:leaves2:1"
          ],
          "target_selection_method": "random"
        }
      },
      "silverlabs_nat:transition_to_ground": {
        "minecraft:behavior.nap": {
          "priority": 0,
          "cooldown_min": 0,
          "cooldown_max": 0
        },
        "minecraft:timer": {
          "looping": false,
          "time": 1,
          "time_down_event": {
            "event": "silverlabs_nat:timer_complete"
          }
        }
      },
      "silverlabs_nat:natural_despawn": {
        "minecraft:despawn": {
          "despawn_from_distance": {},
          "remove_child_entities": true
        }
      },
      "silverlabs_nat:persistent": {
        "minecraft:persistent": {}
      }
    },
    "components": {
      "minecraft:behavior.beg": {
        "priority": 9,
        "look_distance": 8,
        "look_time": 4,
        "items": [
          "rabbit",
          "cooked_rabbit",
          "silverlabs_nat:frog_leg",
          "silverlabs_nat:cooked_frog_leg"
        ]
      },
      "minecraft:type_family": {
        "family": [
          "silverlabs_nat:owl",
          "mob"
        ]
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? Math.Random(1,3): 0"
      },
      "minecraft:loot": {
        "table": "loot_tables/sf/nba/entities/owl.loot.json"
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0
      },
      "minecraft:collision_box": {
        "width": 0.5,
        "height": 0.6
      },
      "minecraft:nameable": {},
      "minecraft:health": {
        "value": 12,
        "max": 12
      },
      "minecraft:healable": {
        "force_use": true,
        "items": [
          {
            "item": "rabbit",
            "heal_amount": 2
          },
          {
            "item": "cooked_rabbit",
            "heal_amount": 3
          },
          {
            "item": "silverlabs_nat:frog_leg",
            "heal_amount": 2
          },
          {
            "item": "silverlabs_nat:cooked_frog_leg",
            "heal_amount": 3
          },
          {
            "item": "cookie",
            "heal_amount": 0,
            "effects": [
              {
                "name": "fatal_poison",
                "chance": 1,
                "duration": 1000,
                "amplifier": 0
              }
            ]
          }
        ]
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": {
              "test": "in_lava",
              "subject": "self",
              "operator": "==",
              "value": true
            },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:flying_speed": {
        "value": 0.12
      },
      "minecraft:movement": {
        "value": 0.15
      },
      "minecraft:damage_sensor": {
        "triggers": {
          "cause": "fall",
          "deals_damage": "no"
        }
      },
      "minecraft:jump.static": {},
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:game_event_movement_tracking": {
        "emit_flap": true
      },
      "minecraft:leashable": {
        "soft_distance": 4,
        "hard_distance": 6,
        "max_distance": 10
      },
      "minecraft:balloonable": {},
      "minecraft:behavior.tempt": {
        "priority": 1,
        "within_radius": 16,
        "items": [
          "rabbit",
          "cooked_rabbit",
          "silverlabs_nat:frog_leg",
          "silverlabs_nat:cooked_frog_leg"
        ]
      },
      "minecraft:environment_sensor": {
        "triggers": {
          "filters": [
            {
              "test": "is_variant",
              "value": 1
            },
            {
              "test": "int_property",
              "domain": "silverlabs_nat:variant",
              "operator": "!=",
              "value": 1
            }
          ],
          "event": "silverlabs_nat:set_variant_1"
        }
      },
      "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:empty_knapsack"
                  }
                ]
              },
              "event": "silverlabs_nat:knapsack_no_capture"
            },
            "swing": false
          },
          {
            "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_component",
                    "value": "minecraft:is_tamed"
                  },
                  {
                    "test": "is_sitting",
                    "operator": "!="
                  },
                  {
                    "test": "bool_property",
                    "domain": "silverlabs_nat:is_following_owner",
                    "value": false
                  },
                  {
                    "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
          },
          {
            "on_interact": {
              "filters": {
                "all_of": [
                  {
                    "test": "has_component",
                    "value": "minecraft:is_tamed"
                  },
                  {
                    "test": "is_sitting",
                    "operator": "!="
                  },
                  {
                    "test": "bool_property",
                    "domain": "silverlabs_nat:is_following_owner",
                    "value": true
                  },
                  {
                    "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": {
      "silverlabs_nat:owl_tamed": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:owl_tamed",
                "silverlabs_nat:follow_owner"
              ]
            }
          },
          {
            "remove": {
              "component_groups": [
                "silverlabs_nat:owl_untamed",
                "silverlabs_nat:bird_walking_mode"
              ]
            }
          },
          {
            "filters": {
              "test": "is_baby",
              "subject": "self",
              "operator": "==",
              "value": false
            },
            "add": {
              "component_groups": [
                "silverlabs_nat:bird_flying_mode"
              ]
            },
            "remove": {
              "component_groups": [
                "silverlabs_nat:wander_around_walk",
                "silverlabs_nat:transition_to_ground"
              ]
            },
            "set_property": {
              "silverlabs_nat:movement_mode": "fly"
            }
          },
          {
            "filters": {
              "test": "is_baby",
              "subject": "self",
              "operator": "==",
              "value": true
            },
            "set_property": {
              "silverlabs_nat:movement_mode": "walk"
            }
          }
        ]
      },
      "minecraft:entity_spawned": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:owl_untamed",
                "silverlabs_nat:wander_around_walk",
                "silverlabs_nat:adult"
              ]
            }
          },
          {
            "trigger": "silverlabs_nat:set_variant_1",
            "filters": {
              "any_of": [
                {
                  "test": "has_biome_tag",
                  "value": "taiga"
                },
                {
                  "test": "has_biome_tag",
                  "value": "forest"
                }
              ]
            }
          },
          {
            "trigger": "silverlabs_nat:set_variant_0",
            "filters": {
              "any_of": [
                {
                  "test": "has_biome_tag",
                  "value": "snowy_slopes"
                }
              ]
            }
          },
          {
            "trigger": "silverlabs_nat:bird_set_walking_mode"
          }
        ]
      },
      "minecraft:entity_born": {
        "add": {
          "component_groups": [
            "silverlabs_nat:baby"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:adult"
          ]
        },
        "trigger": "silverlabs_nat:bird_set_walking_mode"
      },
      "silverlabs_nat:ageable_grow_up": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:baby"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:adult",
            "silverlabs_nat:adult_hitbox"
          ]
        }
      },
      "silverlabs_nat:revert_to_baby": {
        "trigger": "silverlabs_nat:become_persistent",
        "add": {
          "component_groups": [
            "silverlabs_nat:baby"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:adult",
            "silverlabs_nat:adult_hitbox"
          ]
        }
      },
      "silverlabs_nat:bird_set_walking_mode": {
        "add": {
          "component_groups": [
            "silverlabs_nat:bird_walking_mode",
            "silverlabs_nat:transition_to_ground",
            "silverlabs_nat:wander_around_walk"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:bird_flying_mode",
            "silverlabs_nat:wander_around_fly"
          ]
        },
        "set_property": {
          "silverlabs_nat:movement_mode": "walk"
        }
      },
      "silverlabs_nat:bird_set_flying_mode": {
        "add": {
          "component_groups": [
            "silverlabs_nat:bird_flying_mode",
            "silverlabs_nat:wander_around_fly"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:bird_walking_mode",
            "silverlabs_nat:wander_around_walk"
          ]
        },
        "set_property": {
          "silverlabs_nat:movement_mode": "fly"
        }
      },
      "silverlabs_nat:follow_owner": {
        "sequence": [
          {
            "filters": {
              "test": "is_baby",
              "subject": "self",
              "operator": "==",
              "value": false
            },
            "add": {
              "component_groups": [
                "silverlabs_nat:follow_owner",
                "silverlabs_nat:bird_flying_mode"
              ]
            },
            "set_property": {
              "silverlabs_nat:is_following_owner": true,
              "silverlabs_nat:movement_mode": "fly"
            },
            "remove": {
              "component_groups": [
                "silverlabs_nat:wander_around_walk",
                "silverlabs_nat:wander_around_fly",
                "silverlabs_nat:bird_walking_mode"
              ]
            },
            "queue_command": {
              "command": [
                "scriptevent silverlabs_nat:whistle_follow"
              ],
              "target": "self"
            }
          },
          {
            "filters": {
              "test": "is_baby",
              "subject": "self",
              "operator": "==",
              "value": true
            },
            "add": {
              "component_groups": [
                "silverlabs_nat:follow_owner",
                "silverlabs_nat:bird_walking_mode"
              ]
            },
            "set_property": {
              "silverlabs_nat:is_following_owner": true,
              "silverlabs_nat:movement_mode": "walk"
            },
            "remove": {
              "component_groups": [
                "silverlabs_nat:wander_around_fly",
                "silverlabs_nat:bird_flying_mode"
              ]
            },
            "queue_command": {
              "command": [
                "scriptevent silverlabs_nat:whistle_follow"
              ],
              "target": "self"
            }
          }
        ]
      },
      "silverlabs_nat:wander_around": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:wander_around_fly"
              ]
            }
          },
          {
            "remove": {
              "component_groups": [
                "silverlabs_nat:follow_owner",
                "silverlabs_nat:bird_walking_mode"
              ]
            },
            "set_property": {
              "silverlabs_nat:is_following_owner": false
            },
            "queue_command": {
              "command": [
                "scriptevent silverlabs_nat:whistle_wander"
              ],
              "target": "self"
            }
          }
        ]
      },
      "silverlabs_nat:timer_complete": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:transition_to_ground"
          ]
        }
      },
      "silverlabs_nat:set_variant_0": {
        "set_property": {
          "silverlabs_nat:variant": 0
        }
      },
      "silverlabs_nat:set_variant_1": {
        "set_property": {
          "silverlabs_nat:variant": 1
        }
      },
      "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:knapsack_no_capture": {}
    }
  }
}