Posted September 30, 20169 yr How and where can I add text to the f3 debug screen? I want to add some additional world details regarding our mod to the f3 debug screen (Not static will change depending on the exact player position).
September 30, 20169 yr Author Yeah i got to RenderGameOverlayEvent.Text. But where do I get an instance of this object to add my text to it? And do I have to add it to a particular class or may I add it to whatever class which gets called once per tick?
September 30, 20169 yr Yeah i got to RenderGameOverlayEvent.Text. But where do I get an instance of this object to add my text to it? And do I have to add it to a particular class or may I add it to whatever class which gets called once per tick? RenderGameOverlayEvent.Text is an event, you need to subscribe to it with an event handler. Events and event handlers are explained here. Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
September 30, 20169 yr Author I know how to add events, but the event object of RenderGameOverlayEvent.Text doesn't give me a world object or anything useful to operate on. @SubscribeEvent public void onDebugOverlay(RenderGameOverlayEvent.Text event) { event.getLeft().add("Colony in distance: "); }
September 30, 20169 yr This event is only fired on the client, which only has a single World : Minecraft#theWorld . Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.
October 1, 20169 yr Author I tried to find out when it is the debug screen. I tried the one under it but when I debugged it I noticed that there is no difference between debug and normal mode. Only the lists are full in debug, but if our users use additional mods checking that won't work. if(event.getType() == RenderGameOverlayEvent.ElementType.DEBUG) { event.getLeft().add("Colony in distance: "); }
October 1, 20169 yr Author Minecraft.getMinecraft().gameSettings.showDebugInfo resolves it. Thanks for the help.
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.