Im trying to track a players location periodically. Therefor im using a task with an interval.
Everything works fine, but if the player dies the location of the player doesnt seem to update anymore.
Any ideas why this does happen?
Most of the stuff is happening in this class CaptureTimer - Pastebin.com but im quite sure everything is fine because I spend 2 hours debugging the whole thing but maybe someone finds anything idk.
The player object gets recreated when they die and respawn. Do not store a Player, store its UUID and grab the player from Sponge.getServer().getOnlinePlayer(UUID) when you need it. As you’ve found out, the Player object for a given player may change in certain circumstances.