Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

  • 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

  • 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.

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.