{
  "format_version": "1.21.50",
  "minecraft:entity": {
    "description": {
      "identifier": "silverlabs_nat:snake",
      "is_spawnable": true,
      "is_summonable": true,
      "is_experimental": false,
      "properties": {
        "silverlabs_nat:is_following_owner": {
          "type": "bool",
          "default": true,
          "client_sync": false
        },
        "silverlabs_nat:is_bellied": {
          "type": "bool",
          "default": false
        },
        "silverlabs_nat:digested_item": {
          "type": "bool",
          "default": false
        }
      },
      "scripts": {
        "animate": [
          "wake_up_check",
          "food_check",
          "digest"
        ]
      },
      "animations": {
        "wake_up_check": "controller.animation.silverlabs_nat.snake.wake_up_check",
        "food_check": "controller.animation.silverlabs_nat.snake.food_check",
        "digest": "controller.animation.silverlabs_nat.snake.digest"
      }
    },
    "component_groups": {
      "silverlabs_nat:snake_angry": {
        "minecraft:angry": {
          "duration": 30,
          "duration_delta": 10,
          "broadcast_anger": true,
          "broadcast_range": 1,
          "calm_event": {
            "event": "silverlabs_nat:become_calm",
            "target": "self"
          }
        },
        "minecraft:behavior.melee_attack": {
          "priority": 2,
          "speed_multiplier": 1.2,
          "track_target": true,
          "reach_multiplier": 1.5
        }
      },
      "silverlabs_nat:snake_empty_belly": {
        "minecraft:movement": {
          "value": 0.2
        }
      },
      "silverlabs_nat:snake_bellied": {
        "minecraft:movement": {
          "value": 0.2
        },
        "minecraft:timer": {
          "looping": false,
          "time": 300,
          "time_down_event": {
            "event": "silverlabs_nat:snake_on_eat"
          }
        }
      },
      "silverlabs_nat:snake_pickup": {
        "minecraft:behavior.pickup_items": {
          "priority": 2,
          "max_dist": 8,
          "goal_radius": 1.5,
          "speed_multiplier": 1.2
        }
      },
      "silverlabs_nat:snake_pickup_delay": {
        "minecraft:attack_cooldown": {
          "attack_cooldown_time": 4,
          "attack_cooldown_complete_event": {
            "event": "silverlabs_nat:pickup_delay_complete",
            "target": "self"
          }
        }
      },
      "silverlabs_nat:snake_wild": {
        "minecraft:tameable": {
          "probability": 0.5,
          "tame_items": [
            "spider_eye",
            "rabbit",
            "cooked_rabbit",
            "silverlabs_nat:morsel",
            "silverlabs_nat:cooked_morsel"
          ],
          "tame_event": {
            "event": "silverlabs_nat:on_tame",
            "target": "self"
          }
        }
      },
      "silverlabs_nat:snake_awake": {
        "minecraft:navigation.climb": {
          "can_path_over_water": true,
          "can_jump": false
        },
        "minecraft:can_climb": {}
      },
      "silverlabs_nat:sleep_initiation": {
        "minecraft:behavior.random_stroll": {
          "priority": 0,
          "xz_dist": 1,
          "y_dist": 7,
          "speed_multiplier": 0
        },
        "minecraft:timer": {
          "time": 0.1,
          "looping": true,
          "time_down_event": {
            "event": "silverlabs_nat:is_asleep",
            "target": "self"
          }
        }
      },
      "silverlabs_nat:snake_asleep": {
        "minecraft:behavior.nap": {
          "priority": 4,
          "cooldown_min": 2,
          "cooldown_max": 4,
          "can_nap_filters": {
            "all_of": [
              {
                "any_of": [
                  {
                    "test": "hourly_clock_time",
                    "operator": "<",
                    "value": 4000
                  },
                  {
                    "test": "hourly_clock_time",
                    "operator": ">",
                    "value": 12000
                  }
                ]
              },
              {
                "none_of": {
                  "all_of": [
                    {
                      "test": "hourly_clock_time",
                      "operator": ">",
                      "value": 18000
                    },
                    {
                      "test": "hourly_clock_time",
                      "operator": "<",
                      "value": 23000
                    }
                  ]
                }
              },
              {
                "test": "has_component",
                "operator": "!=",
                "value": "minecraft:angry"
              },
              {
                "test": "in_block",
                "operator": "!=",
                "value": "water"
              },
              {
                "test": "has_tag",
                "operator": "!=",
                "value": "woken_up"
              }
            ]
          }
        },
        "minecraft:movement": {
          "value": 0
        },
        "minecraft:navigation.generic": {
          "can_walk": false,
          "can_jump": false
        }
      },
      "silverlabs_nat:snake_tame": {
        "minecraft:is_tamed": {},
        "minecraft:healable": {
          "items": [
            {
              "item": "minecraft:spider_eye",
              "heal_amount": 2
            }
          ]
        },
        "minecraft:attack": {
          "damage": 5
        },
        "minecraft:behavior.owner_hurt_by_target": {
          "priority": 1
        },
        "minecraft:behavior.owner_hurt_target": {
          "priority": 2
        },
        "minecraft:sittable": {},
        "minecraft:behavior.stay_while_sitting": {
          "priority": 1
        }
      },
      "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: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": [
          "spider_eye"
        ]
      },
      "minecraft:damage_sensor": {
        "triggers": [
          {
            "cause": "all",
            "on_damage": {
              "filters": {
                "test": "bool_property",
                "domain": "silverlabs_nat:is_bellied",
                "value": true
              },
              "event": "silverlabs_nat:snake_on_hurt",
              "target": "self"
            }
          },
          {
            "cause": "fall",
            "deals_damage": "no"
          }
        ]
      },
      "minecraft:loot": {
        "table": "loot_tables/sf/nba/entities/snake.loot.json"
      },
      "minecraft:is_hidden_when_invisible": {},
      "minecraft:experience_reward": {
        "on_death": "query.last_hit_by_player ? 5: 0",
        "on_bred": "Math.random(1,7)"
      },
      "minecraft:nameable": {},
      "minecraft:type_family": {
        "family": [
          "silverlabs_nat:snake",
          "silverlabs_nat:grass_snake",
          "mob"
        ]
      },
      "minecraft:breathable": {
        "total_supply": 15,
        "suffocate_time": 0
      },
      "minecraft:equip_item": {},
      "minecraft:equipment": {
        "table": "loot_tables/sf/nba/entities/snake_equipment.loot.json"
      },
      "minecraft:collision_box": {
        "width": 0.6,
        "height": 0.7
      },
      "minecraft:health": {
        "value": 10,
        "max": 10
      },
      "minecraft:healable": {
        "items": [
          {
            "item": "minecraft:spider_eye",
            "heal_amount": 2
          }
        ]
      },
      "minecraft:movement": {
        "value": 0.13
      },
      "minecraft:leashable": {
        "soft_distance": 4,
        "hard_distance": 6,
        "max_distance": 10
      },
      "minecraft:inventory": {
        "inventory_size": 1,
        "private": true
      },
      "minecraft:hurt_on_condition": {
        "damage_conditions": [
          {
            "filters": {
              "test": "in_lava",
              "subject": "self",
              "operator": "==",
              "value": true
            },
            "cause": "lava",
            "damage_per_tick": 4
          }
        ]
      },
      "minecraft:movement.basic": {},
      "minecraft:jump.static": {},
      "minecraft:attack": {
        "damage": 5
      },
      "minecraft:behavior.breed": {
        "priority": 1
      },
      "minecraft:breedable": {
        "require_tame": true,
        "inherit_tamed": true,
        "breed_cooldown": 300,
        "breed_items": [
          "spider_eye",
          "rabbit",
          "cooked_rabbit",
          "silverlabs_nat:morsel",
          "silverlabs_nat:cooked_morsel"
        ],
        "breeds_with": {
          "mate_type": "silverlabs_nat:snake",
          "baby_type": "silverlabs_nat:snake_egg"
        },
        "causes_pregnancy": false
      },
      "minecraft:behavior.lay_egg": {
        "priority": 1,
        "goal_radius": 3,
        "lay_seconds": 1,
        "egg_type": "silverlabs_nat:snake_egg_block",
        "target_blocks": [
          "minecraft:sand",
          "minecraft:grass_block",
          "minecraft:dirt",
          "minecraft:mud",
          "minecraft:snow",
          "minecraft:ice",
          "minecraft:packed_ice",
          "minecraft:blue_ice",
          "minecraft:stone",
          "minecraft:deepslate",
          "minecraft:netherrack",
          "minecraft:end_stone"
        ]
      },
      "minecraft:shareables": {
        "singular_pickup": true,
        "items": [
          {
            "item": "minecraft:chicken",
            "admire": true,
            "pickup_limit": 1
          },
          {
            "item": "minecraft:rabbit",
            "admire": true,
            "pickup_limit": 1
          },
          {
            "item": "minecraft:rabbit_foot",
            "admire": true,
            "pickup_limit": 1
          },
          {
            "item": "minecraft:slime_ball",
            "admire": true,
            "pickup_limit": 1
          },
          {
            "item": "minecraft:egg",
            "admire": true,
            "pickup_limit": 1
          }
        ]
      },
      "minecraft:behavior.admire_item": {
        "priority": 2
      },
      "minecraft:admire_item": {
        "duration": 3,
        "cooldown_after_being_attacked": 10
      },
      "minecraft:behavior.float": {
        "priority": 0
      },
      "minecraft:behavior.hurt_by_target": {
        "priority": 1
      },
      "minecraft:behavior.nearest_attackable_target": {
        "priority": 2,
        "entity_types": {
          "filters": {
            "all_of": {
              "test": "bool_property",
              "operator": "!=",
              "domain": "silverlabs_nat:is_bellied"
            },
            "any_of": [
              {
                "test": "is_family",
                "subject": "other",
                "value": "rabbit"
              },
              {
                "test": "is_family",
                "subject": "other",
                "value": "chicken"
              },
              {
                "test": "is_family",
                "subject": "other",
                "value": "silverfish"
              },
              {
                "test": "is_family",
                "subject": "other",
                "value": "snail"
              },
              {
                "all_of": [
                  {
                    "test": "is_family",
                    "subject": "other",
                    "value": "slime"
                  },
                  {
                    "test": "is_variant",
                    "subject": "other",
                    "value": 1
                  }
                ]
              }
            ]
          },
          "max_dist": 10
        }
      },
      "minecraft:behavior.equip_item": {
        "priority": 2
      },
      "minecraft:behavior.look_at_player": {
        "priority": 6,
        "look_distance": 6,
        "probability": 0.02
      },
      "minecraft:behavior.random_look_around": {
        "priority": 6
      },
      "minecraft:on_target_acquired": {
        "event": "silverlabs_nat:become_angry"
      },
      "minecraft:physics": {},
      "minecraft:pushable": {
        "is_pushable": true,
        "is_pushable_by_piston": true
      },
      "minecraft:follow_range": {
        "value": 20
      },
      "minecraft:conditional_bandwidth_optimization": {},
      "minecraft:scheduler": {
        "min_delay_secs": 0,
        "max_delay_secs": 0,
        "scheduled_events": [
          {
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    {
                      "test": "hourly_clock_time",
                      "operator": "<",
                      "value": 4000
                    },
                    {
                      "test": "hourly_clock_time",
                      "operator": ">",
                      "value": 12000
                    }
                  ]
                },
                {
                  "none_of": {
                    "all_of": [
                      {
                        "test": "hourly_clock_time",
                        "operator": ">",
                        "value": 18000
                      },
                      {
                        "test": "hourly_clock_time",
                        "operator": "<",
                        "value": 23000
                      }
                    ]
                  }
                },
                {
                  "any_of": [
                    {
                      "test": "has_component",
                      "value": "minecraft:is_tamed",
                      "operator": "!="
                    },
                    {
                      "all_of": [
                        {
                          "test": "bool_property",
                          "domain": "silverlabs_nat:is_following_owner",
                          "value": false
                        },
                        {
                          "test": "has_component",
                          "value": "minecraft:is_tamed"
                        }
                      ]
                    }
                  ]
                },
                {
                  "test": "has_component",
                  "operator": "!=",
                  "value": "minecraft:angry"
                },
                {
                  "test": "in_block",
                  "operator": "!=",
                  "value": "water"
                },
                {
                  "test": "has_tag",
                  "operator": "!=",
                  "value": "woken_up"
                }
              ]
            },
            "event": "silverlabs_nat:initiate_sleep"
          },
          {
            "filters": {
              "all_of": [
                {
                  "none_of": [
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "chicken"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "rabbit"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "rabbit_foot"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "slime_ball"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "egg"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "feather"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "silverlabs_nat:snail_shell"
                    }
                  ]
                },
                {
                  "test": "bool_property",
                  "domain": "silverlabs_nat:is_bellied",
                  "value": true
                }
              ]
            },
            "event": "silverlabs_nat:is_contracted"
          },
          {
            "filters": {
              "all_of": [
                {
                  "any_of": [
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "chicken"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "rabbit"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "rabbit_foot"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "slime_ball"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "egg"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "feather"
                    },
                    {
                      "test": "has_equipment",
                      "domain": "hand",
                      "value": "silverlabs_nat:snail_shell"
                    }
                  ]
                },
                {
                  "test": "bool_property",
                  "domain": "silverlabs_nat:is_bellied",
                  "value": false
                }
              ]
            },
            "event": "silverlabs_nat:is_bellied"
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_sleeping",
                  "value": false
                },
                {
                  "test": "has_component",
                  "operator": "!=",
                  "value": "minecraft:can_climb"
                }
              ]
            },
            "event": "silverlabs_nat:is_awake"
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "is_sleeping",
                  "value": true
                },
                {
                  "test": "has_component",
                  "operator": "==",
                  "value": "minecraft:can_climb"
                }
              ]
            },
            "event": "silverlabs_nat:is_asleep"
          },
          {
            "filters": {
              "all_of": [
                {
                  "test": "all_slots_empty"
                },
                {
                  "test": "has_component",
                  "operator": "!=",
                  "value": "minecraft:behavior.pickup_items"
                },
                {
                  "test": "has_component",
                  "operator": "!=",
                  "value": "minecraft:attack_cooldown"
                }
              ]
            },
            "event": "silverlabs_nat:pickup_delay_complete"
          }
        ]
      },
      "minecraft:interact": {
        "interactions": [
          {
            "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": {
      "minecraft:entity_spawned": {
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_wild",
            "silverlabs_nat:wander_around"
          ]
        }
      },
      "silverlabs_nat:entity_born": {
        "trigger": "minecraft:entity_spawned"
      },
      "silverlabs_nat:become_angry": {
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_angry"
          ]
        }
      },
      "silverlabs_nat:become_calm": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:snake_angry"
          ]
        }
      },
      "silverlabs_nat:is_contracted": {
        "set_property": {
          "silverlabs_nat:is_bellied": false
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:snake_bellied"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_empty_belly"
          ]
        }
      },
      "silverlabs_nat:is_bellied": {
        "set_property": {
          "silverlabs_nat:is_bellied": true
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_bellied"
          ]
        },
        "trigger": "silverlabs_nat:become_calm"
      },
      "silverlabs_nat:pickup_delay_complete": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:snake_pickup_delay"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_pickup"
          ]
        }
      },
      "silverlabs_nat:snake_on_hurt": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:snake_pickup"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_pickup_delay"
          ]
        }
      },
      "silverlabs_nat:is_awake": {
        "sequence": [
          {
            "add": {
              "component_groups": [
                "silverlabs_nat:snake_awake"
              ]
            },
            "remove": {
              "component_groups": [
                "silverlabs_nat:snake_asleep"
              ]
            }
          },
          {
            "filters": {
              "any_of": [
                {
                  "test": "has_component",
                  "value": "minecraft:is_tamed",
                  "operator": "!="
                },
                {
                  "all_of": [
                    {
                      "test": "bool_property",
                      "domain": "silverlabs_nat:is_following_owner",
                      "value": false
                    },
                    {
                      "test": "has_component",
                      "value": "minecraft:is_tamed"
                    }
                  ]
                }
              ]
            },
            "add": {
              "component_groups": [
                "silverlabs_nat:wander_around"
              ]
            }
          },
          {
            "filters": {
              "test": "bool_property",
              "domain": "silverlabs_nat:is_bellied",
              "value": true
            },
            "trigger": "silverlabs_nat:is_bellied"
          },
          {
            "filters": {
              "test": "bool_property",
              "domain": "silverlabs_nat:is_bellied",
              "value": false
            },
            "trigger": "silverlabs_nat:is_contracted"
          }
        ]
      },
      "silverlabs_nat:initiate_sleep": {
        "stop_movement": {},
        "remove": {
          "component_groups": [
            "silverlabs_nat:snake_awake"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:sleep_initiation"
          ]
        }
      },
      "silverlabs_nat:is_asleep": {
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_asleep"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:sleep_initiation"
          ]
        }
      },
      "silverlabs_nat:snake_on_eat": {
        "set_property": {
          "silverlabs_nat:digested_item": true
        }
      },
      "silverlabs_nat:snake_on_finish_eat": {
        "set_property": {
          "silverlabs_nat:digested_item": false
        },
        "trigger": "silverlabs_nat:is_contracted"
      },
      "silverlabs_nat:on_tame": {
        "remove": {
          "component_groups": [
            "silverlabs_nat:snake_wild"
          ]
        },
        "add": {
          "component_groups": [
            "silverlabs_nat:snake_tame",
            "silverlabs_nat:follow_owner"
          ]
        }
      },
      "silverlabs_nat:follow_owner": {
        "add": {
          "component_groups": [
            "silverlabs_nat:follow_owner"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:wander_around"
          ]
        },
        "set_property": {
          "silverlabs_nat:is_following_owner": true
        },
        "queue_command": {
          "command": [
            "scriptevent silverlabs_nat:whistle_follow"
          ],
          "target": "self"
        }
      },
      "silverlabs_nat:wander_around": {
        "add": {
          "component_groups": [
            "silverlabs_nat:wander_around"
          ]
        },
        "remove": {
          "component_groups": [
            "silverlabs_nat:follow_owner"
          ]
        },
        "set_property": {
          "silverlabs_nat:is_following_owner": false
        },
        "queue_command": {
          "command": [
            "scriptevent silverlabs_nat:whistle_wander"
          ],
          "target": "self"
        }
      },
      "silverlabs_nat:natural_despawn": {
        "add": {
          "component_groups": [
            "silverlabs_nat:natural_despawn"
          ]
        }
      }
    }
  }
}