Posted December 22, 20159 yr 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.
December 22, 20159 yr 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.
December 27, 20159 yr 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
December 27, 20159 yr 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.