{
    "format_version": "1.19.0",
    "animation_controllers": {
        "controller.animation.button.behavior": {
            "states": {
                "default": {
                    "on_entry": [
                        "/event entity @s clicked_done"
                    ],
                    "transitions": [
                        {"clicked_play": "query.health(1) == 5"},
                        {"clicked_draw": "query.health(1) == 6"},
                        {"clicked_keep": "query.health(1) == 7"},
                        {"ui_drawstack_disabled": "query.health(1) == 15"},
                        {"ui_drawstack_enabled": "query.health(1) == 16"},
                        {"ui_startminus": "query.health(1) == 13"},
                        {"ui_startplus": "query.health(1) == 14"},
                        {"ui_startminus_clicked": "query.health(1) == 23"},
                        {"ui_startplus_clicked": "query.health(1) == 24"},
                        {"leaderboard_show_enabled": "query.skin_id == 1"},
                        {"leaderboard_show_disabled": "query.skin_id == 2"},
                        {"leaderboard_reset": "query.skin_id == 3"}
                    ]
                },

                "clicked_play": {
                    "on_entry": [
                        "/execute @a[tag=turn] ~ ~ ~ playsound random.click @s",
                        "/tag @e[tag=temp] add fromdrawbutton",
                        "/execute @e[tag=temp] ~ ~ ~ function card_interact/interact"
                    ],
                    "transitions": [
                        {
                            "default": "1"
                        }
                    ]
                },
                "clicked_draw": {
                    "on_entry": [
                        "/execute @a[tag=turn] ~ ~ ~ playsound random.click @s",
                        "/function button_interact/draw"
                    ],
                    "transitions": [
                        {
                            "default": "1"
                        }
                    ]
                },
                "clicked_keep": {
                    "on_entry": [
                        "/execute @a[tag=turn] ~ ~ ~ playsound random.click @s",
                        "/execute @s[tag=p1_keepbutton] ~ ~ ~ function button_interact/keep",
                        "/execute @s[tag=p2_keepbutton] ~ ~ ~ function button_interact/keep",
                        "/execute @s[tag=p3_keepbutton] ~ ~ ~ function button_interact/keep",
                        "/execute @s[tag=p4_keepbutton] ~ ~ ~ function button_interact/keep"
                    ],
                    "transitions": [
                        {
                            "default": "1"
                        }
                    ]
                },






                "ui_drawstack_disabled": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/event entity @s ui_drawstacking_disabled",
                        "/scoreboard players set @e[tag=dummy] drawstacking_ui 0",
                        "/clone 65 17 -76 65 17 -76 65 20 -75",
                        "/function debug/startingcards_sign"
                    ],
                    "transitions": [
                            {"ui_drawstack_enabled": "query.health(1) == 16"}
                    ]
                },


                "ui_drawstack_enabled": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/event entity @s ui_drawstack_enabled",
                        "/scoreboard players set @e[tag=dummy] drawstacking_ui 1",
                        "/clone 65 17 -74 65 17 -74 65 20 -75",
                        "/function debug/startingcards_sign"
                    ],
                    "transitions": [
                            {"ui_drawstack_disabled": "query.health(1) == 15"}
                    ]
                },















                "ui_startminus": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/scoreboard players remove @e[tag=dummy] startingcards_ui 1",
                        "/scoreboard players set @e[tag=dummy,scores={startingcards_ui=..0}] startingcards_ui 20",
                        "/function debug/startingcards_sign"
                    ],
                    "transitions": [
                            {"ui_startminus_clicked": "query.health(1) == 23"}
                    ]
                },
                "ui_startminus_clicked": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/scoreboard players remove @e[tag=dummy] startingcards_ui 1",
                        "/scoreboard players set @e[tag=dummy,scores={startingcards_ui=..0}] startingcards_ui 20",
                        "/function debug/startingcards_sign"
                    ],
                    "transitions": [
                        {"ui_startminus": "query.health(1) == 13"}
                    ]
                },







                "ui_startplus": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/scoreboard players add @e[tag=dummy] startingcards_ui 1",
                        "/scoreboard players set @e[tag=dummy,scores={startingcards_ui=21..}] startingcards_ui 1",
                        "/function debug/startingcards_sign"
                    ],
                    "transitions": [
                            {"ui_startplus_clicked": "query.health(1) == 24"}
                    ]
                },
                "ui_startplus_clicked": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/scoreboard players add @e[tag=dummy] startingcards_ui 1",
                        "/scoreboard players set @e[tag=dummy,scores={startingcards_ui=21..}] startingcards_ui 1",
                        "/function debug/startingcards_sign"
                        
                    ],
                    "transitions": [
                        {"ui_startplus": "query.health(1) == 14"}
                    ]
                },
























                "leaderboard_show_disabled": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/scoreboard objectives setdisplay sidebar",
                        "/clone 113.5 20 -77.5 113.5 20 -77.5 109.5 21 -76.5"
                    ],
                    "transitions": [
                        {"leaderboard_show_enabled": "query.skin_id == 1"}
                    ]
                },


                "leaderboard_show_enabled": {
                    "on_entry": [
                        "/playsound random.click @a",
                        "/scoreboard objectives setdisplay sidebar leaderboard",
                        "/clone 113.5 21 -77.5 113.5 21 -77.5 109.5 21 -76.5"
                    ],
                    "transitions": [
                        {"leaderboard_show_disabled": "query.skin_id == 2"}
                    ]
                },


                "leaderboard_reset": {
                    "on_entry": [
                        "/execute @e[tag=dummy,scores={resetlb=..20}] ~ ~ ~ playsound random.click @a",
                        "/execute @e[tag=dummy,scores={resetlb=..20}] ~ ~ ~ function resetleaderboard"
                    ],
                    "transitions": [
                        { "leaderboard_reset2": "query.skin_id == 4"}
                    ]
                },


                "leaderboard_reset2": {
                    "on_entry": [
                        "/event entity @s ui_resetlb"
                    ],
                    "transitions": [
                        { "default": "query.skin_id == 3"}
                    ]
                }

            }
        }
    }
}
