Jump to content

Recommended Posts

Posted

Hey there,

I am trying to make a mod that draws text to the screen. (It does a lot more but it doesn't matter)

I am trying to use this code to draw a string:

 

Minecraft.getMinecraft().fontRenderer.drawString({arguments});

 

but, it just throws an error saying 

 

java.lang.RuntimeException: No OpenGL context found in the current thread.

 

Is there any way to fix this or maybe set an OpenGL context to the fontRenderer?

Posted
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.NORMAL)
public void onRenderExperienceBar(RenderGameOverlayEvent e)
{
    //Debug message to see if it fires
    System.out.println("RenderGameOverlayEvent fired!");

    Minecraft minecraft = Minecraft.getMinecraft();
    
    minecraft.fontRenderer.drawString(arguments here bla bla bla);
}

 

Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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