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

How can I create a tool that has an inventory?  I have some experience with tools and tile entities, but am unsure how I would combine them.

Design with Item+IInventory, saving to ItemStack's NBT, showing with GuiContainer and Container.

1.7.10 is no longer supported by forge, you are on your own.

  • Author

Design with Item+IInventory, saving to ItemStack's NBT, showing with GuiContainer and Container.

 

Thankyou!  It's working for the most part.  I'm going to work on saving the items after I figure out how many items the itemstack can hold.

 

I am, however, having a different problem.  When I shift click an item from my inventory while I have the gui open, it disappears.  Same thing happens when I shift click from it's inventory.

 

When I drag and drop an item into the itemstacks inventory, the stack size is doubled.

 

It's getting late and I've checked many locations for the error, but am still unsure as to what it is.  Any help is greatly appreciated!

 

Thanks a bunch!

 

 

ItemStack.  -- It's messy:(  Sorry

http://pastebin.com/WZ3jY6VT

 

ContainerTunneler

http://pastebin.com/WspW5Tbc

 

GUITunneler

http://pastebin.com/wLQL2M4k

Few things:

1. There is only one Item instance in whole game. You can't have any field there as they will be shared.

2. I might have been unclear with "Item+IInventory", sorry. You want rather separate implementations since as told - there is one Item per game, but there may be more inventories. You want to create inventory and fill it with data from ItemStack's NBT when you open your Container and make container display this inventory.

 

I don't know why I didn't link this alredy:

http://www.minecraftforum.net/forums/mapping-and-modding/mapping-and-modding-tutorials/1571597-forge-1-6-4-1-8-custom-inventories-in-items-and

1.7.10 is no longer supported by forge, you are on your own.

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.