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.

[1.15] ItemStack's capability data is not being synced with the client.

Featured Replies

Posted

One of the items in my mod is supposed to be syncing it's NBT data to the client using ItemStack::getShareTag and ItemStack::readShareTag.

I've tried putting breakpoints in these methods, but they don't seem to be getting called at all.

Is something wrong with my installation?

 

My forge version is 1.15.2-31.2.31, in case that helps.

 

Any help would be appreciated.

  • Author

Ok, so I think I'll go into a little bit more detail:

The item has a custom capability that stores the ItemStack's temperature. When the stack is placed into the output slot of one of the tile entities in my mod, it is supposed to keep the temperature of the stack the same as the tile entity. However, it only does this for the stack on the server side (I've checked with eclipse's debugger).

 

Here's the code for the tile entity, in case that helps:

https://github.com/Awsomekeldeo/RealisTech/blob/f45e7b906509c6171c3bb71384f8c64c2356117c/src/main/java/awsome/realistech/tileentity/CrucibleTileEntity.java

  • Author

It appears as if ItemStack::readShareTag is only getting called once (on stack creation) and never again.

I'll try poking around with the debugger a bit more.

  • Author

I managed to fix it by serializing the NBT data inside the capability wrapper.

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.