I'm making a PVP server on Xbox One, and I need a command to put into a command block to detect if a person hits the score of 0 because 0 means that they left the game, and I need a way to delete that user, "Offline Player" from the scoreboard


Well, there is a way to detect the score of 0, /execute if entity @a[scores={<score>=0}] run <command>. But, if you want to detect if a player left the game, you can do these commands instead:

/scoreboard objectives add leftGame minecraft.custom:minecraft.leave_game

And these in repeating command blocks:

/execute if entity @a[scores={leftGame=1}] run <command>

/scoreboard players set @a leftGame 0

Edit: To reset a scoreboard, use /scoreboard players reset

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.