Posted October 28, 201410 yr Whats the appropriate to check for if a certain block is placed in a slot. I know how to do items, but not blocks. I tried looking at some vanilla code but didn't find a good example. Guess the overall question is how do I pass the block into the itemstack parameter. If I had a good example to look at I would read it myself but haven't found one.
October 28, 201410 yr Blocks don't exist in inventories, they exist as ItemBlocks, a subclass of Item. Get an ItemBlock for the Block with Item.getItemFromBlock(block). Check out my mod, Realms of Chaos, here. If I helped you, be sure to press the "Thank You" button!
October 28, 201410 yr Author Ahh ok, I thought there was a getItemFromBlock(), but I was trying to do itemstack.getItemFromBlock() and not just Item.getItemFromBLock().
October 29, 201410 yr You could also made it into the slot directly https://bitbucket.org/Dragonisser/cobaltmod/src/178c28c1f444b11466696e40bcbfb0f8978acf76/cobaltmod/gui/SlotBackpack.java?at=master
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.