Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

chewdri

Members
  • Joined

  • Last visited

  1. 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
  2. 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; } }
  3. problem solved public void actionPerformed(GuiButton button) { this.mc.displayGuiScreen((GuiScreen)null); this.controlList.clear(); this.mc.displayGuiScreen(new Guipage2(this.player)); }
  4. 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
  5. 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 ?

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.