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.

[SOLVED][1.6.4] How to sync mob's custom field between client and server?

Featured Replies

Posted

Hello guys,

I feel pretty newbie asking this, but I'm not sure what's the best way to do it.

 

I have a mob that has got the custom field "species". Depending on this value, the client must render a different model. So how can I sync this value between server and the clients? I don't want to use the dataWatcher for this so small and "easy" thing. Do you know any better way?

 

Of course "species" value is set only when the mob is created the first time, then it's saved in the NBT but it will never change.

 

Thanks in advance,

Axel

Hi

 

Three ideas-

(1) turn your single entity into two entities that share all the same code except for that one field

(2) datawatcher (to be honest this is actually not so bad)

(3) custom data packet

 

I'd recommend the datawatcher myself, or splitting into two entities.

 

-TGG

  • Author

Thanks TGG,

but I solved using IEntityAdditionalData interface. Nice ideas anyway, but remember that DataWatcher has a limit and my mod is already using 3 values of it.

 

Bye,

Axel :)

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.