Tim3Game Posted June 13, 2017 Posted June 13, 2017 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); } } } } Quote
Tim3Game Posted June 14, 2017 Author Posted June 14, 2017 And what thinks like Debug, EscapeMenu and thinks like that ? Quote
draganz Posted June 14, 2017 Posted June 14, 2017 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. Quote
Tim3Game Posted June 14, 2017 Author Posted June 14, 2017 I had to change something, but it worked like butter, really thanks diesieben07 und draganz Quote
Recommended Posts
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.