{
  "format_version": "1.10.0",
  "animation_controllers": {
    "controller.animation.silverlabs_nat.kiwi.digging_control": {
      "states": {
        "default": {
          "transitions": [
            {
              "init": "!q.is_tamed"
            }
          ]
        },
        "init": {
          "on_entry": [
            "/event entity @s silverlabs_nat:end_feeling_happy",
            "/event entity @s silverlabs_nat:scenting"
          ],
          "transitions": [
            {
              "test_digging_success": "query.property('silverlabs_nat:digging_states') == 'test_digging_success'"
            }
          ]
        },
        "test_digging_success": {
          "on_entry": [
            "/function sf/nba/gameplay/digging/init_digging"
          ],
          "on_exit": [
            "v.stand_delay_trigger = query.life_time + 2;"
          ],
          "transitions": [
            {
              "digging_successful": "query.property('silverlabs_nat:digging_states') == 'successful'"
            },
            {
              "digging_unsuccessful": "query.property('silverlabs_nat:digging_states') == 'unsuccessful'"
            }
          ]
        },
        "digging_successful": {
          "on_entry": [
            "/function sf/nba/gameplay/digging/digging_loot"
          ],
          "transitions": [
            {
              "feeling_happy": "query.life_time >= v.stand_delay_trigger"
            }
          ]
        },
        "digging_unsuccessful": {
          "transitions": [
            {
              "default": "query.life_time >= v.stand_delay_trigger"
            }
          ]
        },
        "feeling_happy": {
          "on_entry": [
            "/event entity @s silverlabs_nat:feeling_happy"
          ],
          "transitions": [
            {
              "default": "1"
            }
          ]
        }
      }
    },
    "controller.animation.silverlabs_nat.kiwi.sniffing_control": {
      "states": {
        "default": {
          "transitions": [
            {
              "start_sniffing": "!q.is_tamed && (query.property('silverlabs_nat:digging_states') == 'trigger_digging')"
            }
          ]
        },
        "start_sniffing": {
          "on_entry": [
            "/function sf/nba/gameplay/digging/init_sniffing"
          ],
          "transitions": [
            {
              "default": "query.property('silverlabs_nat:digging_states') != 'trigger_digging'"
            }
          ]
        }
      }
    },
    "controller.animation.silverlabs_nat.kiwi.pickup_control": {
      "states": {
        "default": {
          "transitions": [
            {
              "start_sniffing": "q.is_tamed && !q.is_item_name_any('slot.weapon.mainhand', 'minecraft:wheat')"
            }
          ]
        },
        "start_sniffing": {
          "on_entry": [
            "/replaceitem entity @s slot.weapon.mainhand 0 wheat"
          ],
          "transitions": [
            {
              "start_sniffing": "!q.is_tamed || q.is_item_name_any('slot.weapon.mainhand', 'minecraft:wheat')"
            }
          ]
        }
      }
    },
    "controller.animation.silverlabs_nat.kiwi.following_owner_check": {
      "initial_state": "default",
      "states": {
        "default": {
          "on_entry": [
            "@s silverlabs_nat:not_following_owner"
          ],
          "transitions": [
            { "following": "!q.is_sitting && q.is_tamed" }
          ]
        },
        "following": {
          "on_entry": [
            "@s silverlabs_nat:is_following_owner"
          ],
          "transitions": [
            { "default": "q.is_sitting || !q.is_tamed" }
          ]
        }
      }
    }
  }
}
