Posted January 3, 201510 yr I want to be able and have a tool when on right click places a torch using the normal torch mechanics. Getting the torch to face the right faces is very hard for me to understand. I may be over thinking this but I'm not sure. I used this simple method and return statement that will place a torch but the mechanics are messed up. Here's what I tried: public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10){ return par3World.setBlock(par4, par5, par6, Blocks.torch); } I'm not sure If I'm being really dumb and not thinking right but I think this would be the way to do it but I need to incorporate the par4, par5, par6 (x, y, z) and with the world and entityplayer to do the torch mechanics. If anyone knows how to do this help would be much appreciated. Thanks ~vandy22
January 3, 201510 yr Torches (and many other blocks) use metadata to determine orientation, meaning you also need to set the correct metadata value for the block. For examples of how to do so, you should check out the ItemBlock class. http://i.imgur.com/NdrFdld.png[/img]
January 3, 201510 yr Author Thanks! I figured it out very quickly actually. I appreciate the response so quickly also! Thanks again ~vandy22
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.