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

How do I get an entities ID client side? I'm trying to send a packet to the server to find the server side copy of the entity to get info from for the client side entity, but I can't figure out how to get the integer ID from the client side entity. Any ideas?

entity.getEntityId(), but what kind of info are you trying to get, and why do you need to send a packet from the client to the server? If it's your entity, you should either implement IEntityAdditionalSpawnData to get the extra data to the client when the entity spawns, or use DataWatcher or packets to keep whatever fields you are watching up-to-date on the client.

  • Author

entity.getEntityId(), but what kind of info are you trying to get, and why do you need to send a packet from the client to the server? If it's your entity, you should either implement IEntityAdditionalSpawnData to get the extra data to the client when the entity spawns, or use DataWatcher or packets to keep whatever fields you are watching up-to-date on the client.

 

So the entity is basically a snowball (I copied the Throwable entity class and changed a few values to change how it flew). The throwable entity class has a Thrower value on it to track the entity that threw it, this is built into the vanilla throwable entity class too. I'm trying to do some calculations based on the thrower, yet, the client version of the entity doesn't register the thrower, only the server side entity does. Because of this, I keep getting null pointer exceptions! Would one of your suggestions help fix that?

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.