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

Hello, I have a little problem. I new to Minecraft modding and I was trying to make a mod with random things, one of them a overlay with informations. It's all working, but the problem is, that the CHAT section is rendering event if the Chat is not opened, and the same thing for the TEXT section is rendering even in debug, where it's overlapping. I added a statement that it shouldn't render when the ElementType.DEBUG is active but even that isn't working, and all tutorials I founded where for older versions.

 

 

CODE:

@SideOnly(Side.CLIENT)
public class onRenderGameOverlay {

    @SubscribeEvent
    public void onRenderOverlay(RenderGameOverlayEvent.Pre e) {
        if (Minecraft.getMinecraft() != null && Minecraft.getMinecraft().player != null) {
            Minecraft mc = Minecraft.getMinecraft();
            FontRenderer fr = mc.fontRendererObj;

            if (e.getType() == RenderGameOverlayEvent.ElementType.TEXT) {

                // Name
                fr.drawStringWithShadow(TextFormatting.BLUE + "" + TextFormatting.BOLD + Reference.FULL_NAME + TextFormatting.DARK_GREEN + " " + TextFormatting.BOLD + "v." + Reference.VERSION, 3, 5, 0xffffff);

                // Player Data
                fr.drawStringWithShadow(TextFormatting.DARK_GRAY + "[" + TextFormatting.GOLD + "Name" + TextFormatting.DARK_GRAY + "] " + TextFormatting.WHITE + mc.player.getName(), 3, 20, 0xffffff);
                fr.drawStringWithShadow(TextFormatting.DARK_GRAY + "[" + TextFormatting.GOLD + "FPS" + TextFormatting.DARK_GRAY + "] " + TextFormatting.WHITE + Minecraft.getDebugFPS(), 3, 40, 0xffffff);



                fr.drawString(Main.DATA_DEV + "", 100, 100, 0xffffff);


                // DEV DATA
                if (Main.DATA_DEV) {
                    fr.drawStringWithShadow(TextFormatting.DARK_PURPLE + "[" + TextFormatting.LIGHT_PURPLE + "UUID" + TextFormatting.DARK_PURPLE + "] " + TextFormatting.WHITE + mc.player.getUniqueID(), 3, e.getResolution().getScaledHeight()-15, 0xffffff);
                }

            } else
            if (e.getType() == RenderGameOverlayEvent.ElementType.CHAT) {

                ScaledResolution res = e.getResolution();

                //Color Codes
                fr.drawStringWithShadow(TextFormatting.AQUA + "&c - AQUA", res.getScaledWidth()-50, res.getScaledHeight()-50, 0xffffff);

            }
        }
    }
}

 

Interesting grammar choice, but scroll through the gui folder in the Minecraft source code, all the GUIs are there, just take in to consideration of how they might be named, then look into their functionality (I find the buttons the most helpful) and decide if that truly is the GUI you are looking for. If I have this correct, the GuiOverlayDebug and GuiIngameMenu are the specific classes you are looking for.

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.