Tracking the dimension the player is in
puncrafter opened this issue ยท 2 comments
Is there a way to make a variable persist even after relogging?
I want to track what dimension the player is by using the PlayerChangedDimension event, and it works fine until the player relogs and the variable resets.
Alternatively, is there a better way to check which dimension the player is in?
Pastebin of the script in question, if it helps: https://pastebin.com/eTmKz12y
You should ask here:
https://discord.blamejared.com
To set you in the right direction though, IPlayer extends IEntity
IEntity has:
IData getNBT();
void update(IData data);
So you can get the current data, and update it with new data
Entity NBT is saved to file (for players their .dat files) and would allow storing variables across scripts / world loads