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
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;
}
}
AndyLun -> I looked class "Guibuttonnextpage" "Guibutton" and "GuiScreenBook" I found the code to close a book "this.mc.displayGuiScreen((GuiScreen)null);" but not for Open a new specific Gui.
Kore -> My book is not like basic book in minecraft. It has specific Cover, specific skin and specific fonction
Hi, sorry for my bad english.
I'm new in modding, i follow lot of forge tutoriel, and I have created some item, blocs and mobs. Now I try to mod Gui.
I have created and item "book", when I right click with this object, it open a new windows (it's the book cover) and there is a button "page 1" on this cover.
When I click on this button, i would open a new Gui (page 1) but I dont know the code to do this, someone can help me ?