scoreboard players add .count player 1
execute as @r[tag=!player] run tag @s add new_count
execute as @a[tag=new_count] run scoreboard players operation @s player = .count player
tag @a[scores={player=1..}] add player
execute as @a[tag=new_count] run tellraw @a [{"text":"["},{"text":"System","color":"dark_aqua"},{"text":"] ","color":"white"},{"selector":"@s","color":"gold"},{"text":" ist Spieler ","color":"white"},{"score":{"name":"@s","objective":"player"},"color":"gold"}]
tag @a remove new_count
execute unless entity @a[tag=!player] run tellraw @a [{"text":"\n["},{"text":"System","color":"dark_aqua"},{"text":"] Es sind ","color":"white"},{"score":{"name":".count","objective":"player"},"color":"gold"},{"text":" Spieler registriert worden.","color":"white"}]
execute unless entity @a[tag=!player] run tellraw @a [{"text":"\n["},{"color":"dark_aqua","text":"System"},{"color":"white","text":"] "},{"clickEvent":{"action":"run_command","value":"/execute as @s run function system:remove_player"},"color":"#BD7B7B","hoverEvent":{"action":"show_text","value":[{"text":"Achtung du wirst aus dem System der Map entfernt","color":"dark_red","bold":true,"italic":false}]},"text":"Wenn du nicht als Teilnehmer mit machen möchtest, klick mich an!"}]
execute if entity @a[tag=!player] run function system:playercount
