
execute as @e[family=!misc,type=!item,type=!xp_orb,r=3,tag=team:yellow] at @s run say ...has left §6YELLOW TEAM.
execute as @e[family=!misc,type=!item,type=!xp_orb,r=3,tag=team:red] at @s run say ...has left §4RED TEAM.
execute as @e[family=!misc,type=!item,type=!xp_orb,r=3,tag=team:purple] at @s run say ...has left §5PURPLE TEAM.
execute as @e[family=!misc,type=!item,type=!xp_orb,r=3,tag=team:green] at @s run say ...has left §2GREEN TEAM.
execute as @e[family=!misc,type=!item,type=!xp_orb,r=3,tag=team:blue] at @s run say ...has left §1BLUE TEAM.
tag @e[family=!misc,type=!item,type=!xp_orb,r=3] remove team:blue
tag @e[family=!misc,type=!item,type=!xp_orb,r=3] remove team:red
tag @e[family=!misc,type=!item,type=!xp_orb,r=3] remove team:yellow
tag @e[family=!misc,type=!item,type=!xp_orb,r=3] remove team:purple
tag @e[family=!misc,type=!item,type=!xp_orb,r=3] remove team:green