So, I have a queue system and I want to detect when a player leaves, and when they leave their score on a scoreboard is reset.

I have no clue on how to do this and could not find it anywhere, and I know I can't use an offline player in command blocks, and I can't detect it.



Here are the steps you should take. First:

/scoreboard objectives add JustLeft stat.leaveGame

Creates a score for keeping track of logging out. Then link the next command to a clock:

/scoreboard players set @a[score_JustLeft_min=1] (your objective) 0

Which will reset whatever the objective is. Finally:

/scoreboard players set @a[score_(your objective)_min=1] JustLeft 0

Which resets the "JustLeft" score. You can find all the same steps in the following post:

How to detect if a player logs out of the game in Minecraft?

I don't know which version you're using, so if the above doesn't work it might be due to that. If you specify the version I can help more.

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.