Posted November 28, 201212 yr I'd like to know whether there is any sort of way, in Minecraft Forge API, to draw directly onto the player's HUD. That is, with the health bar, xp bar, hotbar etc. Any ideas?
November 29, 201212 yr I'd like to know whether there is any sort of way, in Minecraft Forge API, to draw directly onto the player's HUD. That is, with the health bar, xp bar, hotbar etc. Any ideas? Yes, on a client side render tick end(this is important), do this: if(Minecraft.getMinecraft().currentScreen == null){ ScaledResolution scaledresolution = new ScaledResolution(Minecraft.getMinecraft().gameSettings, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); FontRenderer fontrenderer = Minecraft.getMinecraft().fontRenderer; int width = scaledresolution.getScaledWidth(); int height = scaledresolution.getScaledHeight(); Minecraft.getMinecraft().entityRenderer.setupOverlayRendering(); //Do your rendering... } That should set you up for everything you need to add anything you want to the gui. If you wanted to replace the gui entirely however, the location of the built in hud is located at Minecraft.getMinecraft().ingameGUI. I assume one could simply assign that to your gui replacement if you wanted to change the hud entirely, although I have never tried it.
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.