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.

Thanks.

New contributor
Atomik is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

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.

New contributor
Andrew is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

Your Answer

Atomik is a new contributor. Be nice, and check out our Code of Conduct.
 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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