I am building a Minecraft survival games map, in which the battle area is on a floating island. My friends discovered that if they are falling to the ground, they can quickly logout and log back in to escape fall damage and not die, thus cheating.
Is there anyway to detect if a player logs out so I can increment their Death score?
I'm building it vanilla, I'm trying to make a whole map automated with just command blocks and redstone, this is the last thing I need to do now.
Best Answer
First, you should set up a scoreboard objective of type
stat.leaveGame
:When a player leaves the world, their JustLeft score will increase by 1 because of its type.
On a clock somewhere, you should then have:
To set the death score of players who have just relogged to 1. Followed by:
So that their JustLeft score is reset after their Death score is set, preventing them being continually killed.
@a
only selects online players, so they should only have their Death score set and then reset when they rejoin the world, even though their JustLeft stat will increase to 1 straight away.