Jump to content

Recommended Posts

Posted

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).

 

 

Posted

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?

Posted
  On 9/30/2016 at 11:34 PM, Raycoms said:

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.

Posted

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: ");
    }

Posted

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.

Posted

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: ");
        }

 

 

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.