Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to clear scoreboard with offline players java

From Whiptail84 on Reddit: 
https://www.reddit.com/r/MinecraftCommands/comments/lwutom/removing_offline_players_from_scoreboard/

#First copy all online players to a temporary scoreboard
execute as @a run scoreboard players operation @s <tempScoreboardName> = @s <ScoreboardName>

#Delete the original scoreboard
scoreboard objectives remove <ScoreboardName>

#Create the scoreboard again
scoreboard objectives add <ScoreboardName> <trigger>

#Copy all players from temporary scoreboard back
execute as @a run scoreboard players operation @s <ScoreboardName> = @s <tempScoreboardName>
 
PREVIOUS NEXT
Tagged: #clear #scoreboard #offline #players #java
ADD COMMENT
Topic
Name
7+9 =