#Project created by the koncept

function koncept.bingo:bingo/start/team_join/team_add

scoreboard players enable @a bingo.startYes

tag @s add bingo.starter_game

scoreboard players enable @a bingo.startYes

scoreboard objectives remove bingo.started_game

scoreboard players reset @s bingo.startYes

scoreboard objectives add count_player_bingo dummy
scoreboard players set count count_player_bingo 0

scoreboard players enable @s bingo.leave.game.yes

# Run a cyclic file to start the game to select the type and difficulty
scoreboard players set start bingo.start.enable.trigger 1

tellraw @s [{"text":"\n"},{"translate":"bingo.start_team_selection","color":"#ffcc64"},{"text":"\n"},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"red",click_event:{action:'run_command',command:"/trigger bingo.team.join.red"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"   "},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"dark_red",click_event:{action:'run_command',command:"/trigger bingo.team.join.dark_red"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"   "},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"yellow",click_event:{action:'run_command',command:"/trigger bingo.team.join.yellow"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"\n"},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"gold",click_event:{action:'run_command',command:"/trigger bingo.team.join.gold"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"   "},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"white",click_event:{action:'run_command',command:"/trigger bingo.team.join.white"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"   "},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"aqua",click_event:{action:'run_command',command:"/trigger bingo.team.join.aqua"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"\n"},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"green",click_event:{action:'run_command',command:"/trigger bingo.team.join.green"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"   "},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"blue",click_event:{action:'run_command',command:"/trigger bingo.team.join.blue"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"   "},{"text":"[","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"translate":"bingo.start_team_selection1","color":"light_purple",click_event:{action:'run_command',command:"/trigger bingo.team.join.light_purple"},hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}},{"text":"]","color":"#ffcc64",hover_event:{action:'show_text',value:{"text":"\u0001","font":"koncept:unicode","color":"white"}}}]

execute as @s at @s run tellraw @a[tag=!bingo.starter_game] [{"selector":"@s","color":"gold"},{"translate":"bingo.start_game_chat","color":"#ffcc64"},{"text":"\n"},{"translate":"bingo.start_game_chat1","color":"#ffcc64"},{"text":" [","color":"#8CF657",click_event:{action:'run_command',command:"/trigger bingo.startYes"}},{"translate":"bingo.start_game_chat2","color":"#8CF657",click_event:{action:'run_command',command:"/trigger bingo.startYes"}},{"text":"]","color":"#8CF657",click_event:{action:'run_command',command:"/trigger bingo.startYes"}}]

scoreboard players set start bingo.start.launch.receipt 1

scoreboard objectives add bingo.start.game.timer dummy

scoreboard players add timer bingo.start.game.timer 1