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

Ok, so I looked at the new writable books, and there was something with the NBTagCompound. Does it store extra data for an item? If it does, can you please tell me how to use it.

Yes, NBTTagCompounds are used to store extra data for an ItemStack. They're not particularly hard to use.

 

You can give a tag compound to an itemstack using

ItemStack.setTagCompound(new NBTTagCompound());

 

You can add a list to your compound using

ItemStack.stackTagCompound.setTag("name", new NBTTagList("name"));

and then access this list using

NBTTagList list = (NBTTagList)ItemStack.stackTagCompound.getTag("name");

 

Once you've got your list, you can add compounds to it with

NBTTagCompound compound = new NBTTagCompound();

and add data to it, like Integers or Booleans using these

compound.setInteger("Integer Name", Value);
compound.setBoolean("Boolean Name", true/false);

 

And then finally to append this compound to the list, you use

list.appendTag(compound);

 

That would produce an ItemStack with a single list, which has inside it an Integer called Integer Name and a Boolean called Boolean Name.

 

Have fun :)

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.