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

I'm trying to take the NBT data from a shulkerbox ItemStack and turn it's contents into a list of ItemStacks. I couldn't find any examples of anyone doing this so I tried doing it myself. So far I have an NBTBase list with things such as:

{Slot:0b,id:"minecraft:diamond_sword",Count:1b,tag:{ench:[{lvl:3s,id:16s}]},Damage:0s}

I can think of a couple of ways to convert this. But nothing simple. Any ideas?

  • Author

Hm, should I use ItemStackHelper.loadAllItems(NBTTagCompound, itemlist)? That looks right. I have no idea what tag I should put in there though.

  • Author

Oh wow you can create an itemstack straight from that nbt tag.

new ItemStack(NBTTagCompound);


Thanks for pointing me in the right direction!

  • Author

Here's exactly what I did to convert the nbt tag to an itemstack.

ItemStack stack = new ItemStack(nbttaglist.get(i));

Anyways, I figured out how to do this in that class you told me to look in. Thanks again for the help.
EDIT: Oh yea it's in a for loop because it's a list of NBTTagCompounds. That's why there's an i.

Edited by ZephaniahNoah

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.