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.

Featured Replies

Posted

I want to make a custom screen overlay. So when a boolean is true, I want that the screen to have a red overlay. I looked up in the IngameGui class and the renderPortalOverlay method but I don t know how to make a custom GUI

Edited by Faro

i tried doing this but cannot find anything in the source code. i looked in 'BlockPumpkin.class' and 'ItemArmor.class' but neither of them have anything about putting a pumpkin on your head. any help is appreciated.

so, did you try full text search? it's not that difficult. it would point you towards the class called IngameGui.

that helped i found the code. its in a file called GuiIngame.java. i dont know the file path for it but it contains a bunch of code for overlay gui effects and stuff so it should help a lot.

steps to find it in intellij are right click on a folder in the project, click 'find in files' button, search for "pumpkinblur.png" and click the scope button.

  • Author

yeah but to use this code I need to make custom GUI and I don t know when to register it or when to call its methods

  • Author

Ok thank you I made it like this and it works.

 @SubscribeEvent
  @OnlyIn(Dist.CLIENT)
  public static void RenderHUD(final RenderGameOverlayEvent event){
        if (isRampage){
           int  screenColor = 0xfff00000;
           Minecraft mc = Minecraft.getInstance();

           
            MatrixStack stack = event.getMatrixStack();
            stack.pushPose();
            int w = (mc.getWindow().getGuiScaledWidth());
            int h = (mc.getWindow().getGuiScaledHeight());

              
                float r = (float) (screenColor >> 16 & 255) / 255.0F;
                float g = (float) (screenColor >> 8 & 255) / 255.0F;
                float b = (float) (screenColor & 255) / 255.0F;
                float a = (1/ 100f) * (screenColor >> 24 & 255) / 255F;

                   RenderSystem.disableTexture();
                   RenderSystem.enableBlend();
                   RenderSystem.disableAlphaTest();
                   RenderSystem.blendFuncSeparate(770, 771, 1, 0);
                   RenderSystem.shadeModel(7425);
                   Tessellator tessellator = Tessellator.getInstance();
                   Matrix4f matrix = stack.last().pose();
                   BufferBuilder worldrenderer = tessellator.getBuilder();
                   worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
                   worldrenderer.vertex(matrix, 0, h, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();


                   worldrenderer.vertex(matrix, w, h, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();
                   worldrenderer.vertex(matrix, w, 0, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();
                   worldrenderer.vertex(matrix, 0, 0, mc.gui.getBlitOffset()).color(r, g, b, a).endVertex();

                   tessellator.end();
                   RenderSystem.shadeModel(7424);
                   RenderSystem.disableBlend();
                   RenderSystem.enableAlphaTest();
                   RenderSystem.enableTexture();
                   


        }
  }

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.