Posted November 21, 201410 yr I have written the following code to replace the Experience bar with a new XP/Magic bar for my mod however, all it renders is a black rectangle. public class GuiXPMagicBar extends Gui { private Minecraft mc = Minecraft.getMinecraft(); @SubscribeEvent public void onRenderExperienceBar(RenderGameOverlayEvent event) { if (event.type == ElementType.EXPERIENCE && !mc.thePlayer.isRidingHorse()) { event.setCanceled(true); if (this.mc.playerController.gameIsSurvivalOrAdventure()) { ScaledResolution scaledresolution = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); int w = scaledresolution.getScaledWidth(); int h = scaledresolution.getScaledHeight(); this.mc.getTextureManager().bindTexture(new ResourceLocation("immersion:textures/gui/magicbar.png")); int cap = this.mc.thePlayer.xpBarCap(); if (cap > 0) { int expl = (int)(this.mc.thePlayer.experience * (float)(183)); int x = w / 2 - 92; int y = h - 32 + 3; this.drawTexturedModalRect(x, y, 0, 0, 182, ; if (expl > 0) { this.drawTexturedModalRect(x, y, 0, 9, expl, ; } } } } } } Any help would be appreciated.
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.