vandy22 Posted January 3, 2015 Share Posted January 3, 2015 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 Quote Link to comment Share on other sites More sharing options...
coolAlias Posted January 3, 2015 Share Posted January 3, 2015 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. Quote http://i.imgur.com/NdrFdld.png[/img] Link to comment Share on other sites More sharing options...
vandy22 Posted January 3, 2015 Author Share Posted January 3, 2015 Thanks! I figured it out very quickly actually. I appreciate the response so quickly also! Thanks again ~vandy22 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.