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.

SirLollington

Members
  • Joined

  • Last visited

Everything posted by SirLollington

  1. So, I've been trying to figure this out for the past few hours, but the documentation is extremely sparse and I haven't been able to figure this out. I want to write some text to the screen, kind of like an FPS meter. Unfortunately for me, my mod currently doesn't display anything at all. There aren't any errors, and from what I have been able to find, the way I'm going about this is correct. I'm using Minecraft 1.11.2. Here's the code in question: import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraftforge.client.event.RenderGameOverlayEvent; import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; @Mod.EventBusSubscriber public class MessageGui extends Gui { private static String text = "Test Text"; private static int color = 0xFFFFFF; private FontRenderer fontRenderer; private void verifyRenderer() { if (fontRenderer != null) return; Minecraft minecraft = Minecraft.getMinecraft(); fontRenderer = minecraft.fontRendererObj; } @SubscribeEvent public void render(RenderGameOverlayEvent.Post event) { verifyRenderer(); fontRenderer.drawStringWithShadow(text, 10, 20, color); } } As far as I've been told, @Mod.EventBusSubscriber and @SubscribeEvent should automatically subscribe the RenderGameOverlayEvent to the correct bus... but it's not doing anything at all. Can someone tell me what I'm missing here? EDIT: I AM creating an instance of this class in my mod's init() function. There shouldn't be a reason for this not to work.

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.