Posted February 21, 20214 yr Hey, Basically, I'm modifying the player's reach with a command (changes reach value in the player's capability), and I need to sync this data to the client (because I want to show the attack indicator next to the cursor if the reach is long and the player is pointing at an entity). Currently (and I'm sort of getting the vibe that I'm not doing this too correctly): I send a packet to the client if the corresponding player has extended reach in the update event. This packet basically adds a custom string tag to the player's tag list (on the client) to let it know that this player does have extended reach. I only send this packet if this tag isn't in the player's tag list on the server. I'm not the best at read and write and NBT stuff in Minecraft so any tips on how to correctly sync it would be appreciated Thank you Edited February 21, 20214 yr by Differentiation
February 22, 20214 yr Author 54 minutes ago, diesieben07 said: Why don't you store it in the client-side capability instead? Well I tried doing that, but every time I clone or log off and back on, it resets the value of that capability on the client
February 22, 20214 yr Author 14 hours ago, diesieben07 said: Send the data in PlayerLoggedInEvent, PlayerRespawnEvent, PlayerChangedDimensionEvent and whenever the data changes. Are those the only three events where I would need to write to the client?
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.