scoreboard players tag @e[type=item] add InitWantToPlay {Item:{id:"minecraft:dye",tag:{display:{Name:"§c§lNot ready to play§r §6§o(drop to switch)"}}}}
execute @e[type=item,tag=InitWantToPlay] ~ ~-1 ~ scoreboard players tag @a[r=2,c=1] remove LobbyAFK
execute @e[type=item,tag=InitWantToPlay] ~ ~-1 ~ scoreboard players tag @a[r=2,c=1] add TryInitLobby

execute @a[tag=TryInitLobby] ~ ~ ~ scoreboard players tag @s[tag=!AFK] add InitLobby
execute @a[tag=TryInitLobby] ~ ~ ~ scoreboard players tag @s[tag=AFK] add AFKCancel
scoreboard players tag @a[tag=TryInitLobby] remove TryInitLobby
kill @e[type=item,tag=InitWantToPlay]

scoreboard players tag @a[tag=InitLobby] add Lobby
title @a[tag=InitLobby] actionbar ["",{"text":"You are ","bold":true,"color":"aqua"},{"text":"Ready to play","bold":true,"color":"green"},{"text":". You are going to play.","bold":true,"color":"aqua"}]
replaceitem entity @a[tag=InitLobby] slot.hotbar.8 minecraft:dye 1 10 {display:{Name:"§a§lReady to play§r §6§o(drop to switch)"}}
stopsound @a[tag=InitLobby] master minecraft:entity.villager.no
execute @a[tag=InitLobby] ~ ~ ~ playsound minecraft:entity.villager.yes ambient @s
function main:scoreboard/lobby if @a[tag=InitLobby]
scoreboard players tag @a[tag=InitLobby] remove InitLobby