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.

ButterChuckles

Members
  • Joined

  • Last visited

Everything posted by ButterChuckles

  1. I am making a mod and I have coded a very simple GUI to appear when I open a chest. Now I need help adding slots to the gui. If you could help me that would be great. Also it would be great if you could let me know about any extra code I need to add so I can properly make the chest work. My coding for the chest looks like this public boolean onBlockActivated(World p_149727_1_, int p_149727_2_, int p_149727_3_, int p_149727_4_, EntityPlayer p_149727_5_, int p_149727_6_, float p_149727_7_, float p_149727_8_, float p_149727_9_) { if (p_149727_1_.isRemote) { return true; } else { IInventory iinventory = this.func_149951_m(p_149727_1_, p_149727_2_, p_149727_3_, p_149727_4_); if (iinventory != null) { Minecraft.getMinecraft().displayGuiScreen(new GuiChest()); } return true; } My coding for the gui looks like this public class GuiChest extends GuiScreen{ int guiWidth = 182; int guiHeight = 187; @Override public void drawScreen(int x, int y, float ticks) { int guiX = (width - guiWidth) / 2; int guiY = (height - guiHeight) / 2; GL11.glColor4f(1, 1, 1, 1); drawDefaultBackground(); mc.renderEngine.bindTexture(new ResourceLocation(RefStrings.MODID, "textures/gui/chestGui.png")); drawTexturedModalRect(guiX, guiY, 35, 39, guiWidth, guiHeight); fontRendererObj.drawString("Grass Chest", guiX + 40, guiY + 5, 0x601959); super.drawScreen(x, y, ticks); } protected void keyTyped(char c, int key) { switch(key){ case Keyboard.KEY_E: mc.displayGuiScreen(null); super.keyTyped(c, key); } } }

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.