Posted November 20, 20204 yr Hi, I want to get NBT of a TileEntity. How do I do it? I already have a TileEntity variable. Thanks for help!
November 20, 20204 yr Something like that: public static CompoundNBT getNbtOfTile(TileEntity tile) { CompoundNBT nbt = new CompoundNBT(); tile.write(nbt); return nbt; }
November 20, 20204 yr Author Well, it works like tile.serializeNBT() When I check chest NBT, it shows Items tag as empty, when there are items inside chest. So your function is not the solution for me.
November 20, 20204 yr Maybe, your check perform on client? And tile on client is not synchronized with server. Try to open chest for sync.
November 20, 20204 yr Author I tried this function on singleplayer, it didnt work even when I opend the chest
November 20, 20204 yr Author Theres no specific reason, I just wanted to get it shown at screen. If it isnt possible, sure I dont need it. BTW, can I do the same thing but with entities?
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.