Posted May 2, 201312 yr Hello, at the moment i'm trying to do a itembackpack, which is like a chest, but you do not have to place it in the world. You craft a item and simply make right click to open a gui. But when i make right click nothing happens. removed In my mod_File i added: NetworkRegistry.instance().registerGuiHandler(this, new GuiHandler()); I do not want to post the whole mod_File because there are many things i've added already for other items and blocks. Now i want to include a backpack. Hope someone can help me.
May 5, 201312 yr player.openGui(mod_FoodEx.instance, 0, world, 0, 0, 0); And from GUI handler: TileEntity tileEntity = world.getBlockTileEntity(x, y, z); if(tileEntity instanceof TileEntityBackpack){ The XYZ passed inn will always be 0, so it will get the TileEntity at 0,0,0 which probably ain't an instanceof TileEntityBackpack. I think you may have to re think what you are trying to do, you're logic is flawed mate. If you guys dont get it.. then well ya.. try harder...
May 5, 201312 yr Also it is not right to use a TileEntity without a block. Use the NBT system the ItemStack provides! Don't ask for support per PM! They'll get ignored! | If a post helped you, click the "Thank You" button at the top right corner of said post! | mah twitter This thread makes me sad because people just post copy-paste-ready code when it's obvious that the OP has little to no programming experience. This is not how learning works.
May 6, 201312 yr Author Is there a tutorial, how to do that with items? I only found it with blocks, and have no idea, where to start. I've already changed the 0,0,0 in openGUI to the player position, but this can't work. I have to use NBT, i understand, but i need some information or a tutorial.
May 6, 201312 yr There's not a tutorial for everything, this is where tutorials stop and one have to start to act like a programmer and study source code, study what other people have done and read the documentation But regarding NBT, I believe that there are some tutorials involving nbt inn general around http://www.minecraftforge.net/wiki/How_to_use_NBT_Tag_Compound If you guys dont get it.. then well ya.. try harder...
May 7, 201312 yr Author Thanks. I read through the Internet and got it already a bit working. I can open a gui and place something in it. But what are the functions to save the Items, that are in the "Backpack", and load them? I don't use TileEntity anymore, cuz it's an item.
May 7, 201312 yr That would be the functions to save and load nbt data as mentioned inn the above linked text:) If you guys dont get it.. then well ya.. try harder...
May 8, 201312 yr Author Hello, it's me again. I've a small question. Where do I've to save the items with writeToNBT ? Loading the items at onItemRightClick, right?
May 13, 201312 yr Author Can someone help me with loading and saving the content? I tried somehting but i didn't work. removed
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.