#Project created by the koncept

scoreboard players add @s bingo.destroy 1

execute at @s[scores={bingo.destroy=10..}] run tellraw @a[tag=bingo.game.player,tag=!bingo.game.player.training] ["",{"translate":"bingo.before_game_starts",hover_event:{action:'show_text',value:{"translate":"bingo.hint_before_game_starts"}},"with":[{"translate":"bingo.before_game_starts1","color":"#8CF657","clickEvent":{"action":"copy_to_clipboard","value":"/trigger .bingo.settings"},"hoverEvent":{"action":"show_text","value":[{"translate":"chat.copy"},{"text":"\ue001","font":"koncept:icon/unicode.bingo","color":"white"}]}}],"color":"#54beea"}]

execute as @s[scores={bingo.destroy=10..}] at @s run tag @a[tag=bingo.game.player] add bingo.game.player.training

execute as @s[scores={bingo.destroy=10..}] at @s run time set day


execute as @s[scores={bingo.destroy=10..}] at @s run fill ~5 ~5 ~5 ~-5 ~-5 ~-5 minecraft:air replace #minecraft:glass_blocks

execute as @s[scores={bingo.destroy=10}] at @s run playsound minecraft:block.note_block.bell master @a[tag=bingo.game.player,distance=..4] ~ ~ ~ 999999999999999999 0.63

execute as @s[scores={bingo.destroy=10..}] at @s run gamemode survival @a[tag=bingo.game.player,distance=..10]

execute as @s[scores={bingo.destroy=10..}] at @s run gamerule fallDamage false

execute as @s[scores={bingo.destroy=10}] at @s run effect give @a[distance=..10] minecraft:saturation 1 55 true

execute as @s[scores={bingo.destroy=10}] at @s run title @a title {"translate":"bingo.bingo","color":"gold"}

# Give a chance to quit the game
execute as @s[scores={bingo.destroy=10}] at @s run scoreboard objectives add bingo.leave.game.yes trigger
execute as @s[scores={bingo.destroy=10}] at @s run scoreboard objectives add .bingo.leave.game trigger
# Allow you to use the settings
execute as @s[scores={bingo.destroy=10}] at @s run scoreboard objectives add .bingo.settings trigger
execute at @s[scores={bingo.destroy=10}] as @s run scoreboard players reset @a .bingo.settings

execute at @s[scores={bingo.destroy=60..}] as @s run gamerule fallDamage true
execute at @s[scores={bingo.destroy=60..}] as @s run scoreboard objectives add bingo.timer.game dummy
execute at @s[scores={bingo.destroy=60..}] as @s run scoreboard players set start bingo.timer.game 1
execute at @s[scores={bingo.destroy=60..}] as @s run tag @a[tag=bingo.game.player] add bingo.game.visibility

kill @e[scores={bingo.destroy=60..}]