scoreboard players set @e[tag=dummy] turn 1


#turn tag
tag * remove turn
execute @e[tag=dummy,scores={turn=1}] ~ ~ ~ tag @a[scores={player_id=1}] add turn
execute @e[tag=dummy,scores={turn=2}] ~ ~ ~ tag @a[scores={player_id=2}] add turn
execute @e[tag=dummy,scores={turn=3}] ~ ~ ~ tag @a[scores={player_id=3}] add turn
execute @e[tag=dummy,scores={turn=4}] ~ ~ ~ tag @a[scores={player_id=4}] add turn


#notification sound
execute @a[tag=turn] ~ ~ ~ playsound note.chime @s


#announce turn
tellraw @a {"rawtext": [{"text": "§6"},{"selector": "@a[tag=turn]"},{"text": " is playing"}]}



#make cards clickable
event entity @e[type=cero:card] stop_clickable
execute @e[tag=dummy,scores={turn=1}] ~ ~ ~ execute @e[type=cero:card,tag=player1] ~ ~ ~ function card_clickable
execute @e[tag=dummy,scores={turn=2}] ~ ~ ~ execute @e[type=cero:card,tag=player2] ~ ~ ~ function card_clickable
execute @e[tag=dummy,scores={turn=3}] ~ ~ ~ execute @e[type=cero:card,tag=player3] ~ ~ ~ function card_clickable
execute @e[tag=dummy,scores={turn=4}] ~ ~ ~ execute @e[type=cero:card,tag=player4] ~ ~ ~ function card_clickable