I'm making a 1.12 map that need to do something when a player join. I tried stats.leavegame method, but if the game crashed the last time, the command won't run.

No file permission for it's hard to share, but unintended file type (like using a file to take the place of a folder, in my answer) is fine

  • 4
    Yay, someone who shows what they tried before! – Fabian Röling May 9 '18 at 8:59
  • So you want to detect every join, not just the first, right? There are certainly ways to detect when the player is there or not, but I'm trying to find a not very laggy, elegant way. I have some ideas already, I'll try some things in the next hours, for example if scoreboard tag on offline players can be used here. – Fabian Röling May 9 '18 at 9:04
  • @Fabian Using tag seems can only detect players except the first one – l4m2 May 9 '18 at 11:39

Self solved , experiment under discussion with chyx

The world loads before player join even if it's single player, so freely assume at the beginning there's no player:

give @a[score_onLine=0] iron_shovel
scoreboard players set * onLine 0
scoreboard players set @a onLine 1

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.