Jump to content

Items not syncing NBT data to client


afenner

Recommended Posts

So I've created an item with a IEnergyStorage Capability via initCapability, and it can receive energy from other blocks and retains its stored energy. But when I attempt to add its currently stored energy to the tooltip via addInformation, the ItemStack supplied has no tag compound.

I've tried using getNBTShareTag to send the server-side storage data to the client, but either the NBT data I'm returning isn't being sent to the client or the ItemStack I'm being given via addInformation is wrong.

 

Here's the relevant code as it currently stands:

https://gitlab.com/snippets/1751590

 

When I update the ItemStack (i.e. move the stack, or transfer energy into its capability) the console outputs:

Share tag: {energy:910}

 

However, when I hover over the stack the console reads:

Stack missing tag compound

 

And the tooltip reads 0

 

Any help as to why this isn't work would be greatly appreciated.

Thanks

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.