Jump to content

[1.15.2] Syncing capability to player client


Differentiation

Recommended Posts

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 by Differentiation
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.