Posted January 29, 201312 yr Hi I would know, what is the code for open a specific Gui when a player right click with a specific object. I know the code with modloader but not the one with forge public class livredecartes extends Item { public livredecartes(int i) { super(i); maxStackSize = 64; this.setCreativeTab(CreativeTabs.tabMaterials); } public String getTextureFile() { return "/chewdri/harrypotterv2/client/Items.png"; } public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10) { ModLoader.openGUI(par2EntityPlayer,new GuiWithButtonr(par2EntityPlayer)); return true; } }
January 30, 201312 yr Author I tried public boolean onItemUse(World world, int x, int y, int z, EntityPlayer player, int i, float f, float g, float t) { player.openGui(harrypotterv2.instance, GuiWithButtonr.ID, world, 0, 0, 0); return true; } } 0 errors, but I open anything when I right click with my item
January 30, 201312 yr Hello! Blaueseichoern has some great GUI tutorials over on the minecraft forums. In post 4 he has a tutorial for the exact thing you are trying to accomplish Also the other GUI tutorials are working with forge as well, so it should give you a good read If you guys dont get it.. then well ya.. try harder...
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.