Posted May 28, 20223 yr Hi! I add a value (e.g. 10) to player's custom persistent data variable and print it out. It's the same on server and client until I exit the world. If I reopen the game (or load the world) the value is still there on server, but on client it's 0. My TileEntity screen gets the value from the player and displays it. But it gets the value only on client which is not the correct value. How to sync this value/variable after I reopen the game/world? I have tried to add a DataParameter to PlayerEntity and use the entityDataManager in the PlayerTickEvent function, but it crashed the game. It's probably not the right way to do it. Any ideas? Thanks.
May 28, 20223 yr I think you need PlayerLoggedInEvent and send a packet to the client to synchronise data. Probably you also need to do this in PlayerChangedDimensionEvent and PlayerEvent.PlayerRespawnEvent.
May 28, 20223 yr Author It works. Thank you very much! I didn't think of that simple solution Edited May 28, 20223 yr by RInventor7
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.