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

So I want to save the data for a TileEntity, just a couple integers and a boolean, first time trying with goals of success to save the data with NBT, but, should I use them? Or the new Capabilities system is the way to go for storing TileEntities data?

Come and say hi at www.twitter.com/JoseluGames

No the Capabilities are for stuff thats similar to other tile entities and stuff that should be compatible with other mods (like Inventory, FluidTank , ...)

Normal data (as you sayed some integer and booleans) are still stored in NBT with the writeToNBT() and readFromNBT() method

What's strange is that your #getUpdatePacket method is not being called at all according to the log, and thus #onDataPacket is not, either... but #writeToNBT and #readFromNBT are both called...

 

Can you show where you register your TileEntity and the related Block class? Perhaps some more context will help track down the issue.

 

Another thing you can try if you haven't already is updating Forge - sometimes things get broken temporarily, and though I don't have any reason to believe that's the case here, it's worth a shot.

In 1.9.4+, you need to override

TileEntity#getUpdateTag

to write the data that needs syncing to a compound tag and return it. You should then override

TileEntity#getUpdatePacket

to use the compound tag returned by

TileEntity#getUpdateTag

.

 

TileEntity#getUpdateTag

is sent with the chunk data,

TileEntity#getUpdatePacket

is sent after that.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

i cant get mine to work either, tried setting what you said overridden in my tile entity extended from TileEntity but writeInternal is set to private. or do i have to make my own TileEentity class. cant really find any examples of working code either, im just trying to store one item and every other part of my code works but this.

i cant get mine to work either, tried setting what you said overridden in my tile entity extended from TileEntity but writeInternal is set to private. or do i have to make my own TileEentity class. cant really find any examples of working code either, im just trying to store one item and every other part of my code works but this.

 

Call

super.getUpdateTag

from your override of

TileEntity#getUpdateTag

.

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

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.