Jump to content
  • Home
  • Files
  • Docs
Topics
  • All Content

  • This Topic
  • This Forum

  • Advanced Search
  • Existing user? Sign In  

    Sign In



    • Not recommended on shared computers


    • Forgot your password?

  • Sign Up
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.4] Replacing F3 screen
Currently Supported: 1.16.X (Latest) and 1.15.X (LTS)
Sign in to follow this  
Followers 1
krypciak

[1.16.4] Replacing F3 screen

By krypciak, November 19, 2020 in Modder Support

  • Reply to this topic
  • Start new topic

Recommended Posts

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

Hi,

i would like to replace the F3 screen. By that I mean I want to display other text on it. But I need help with replacing it.

The F3 screen is in the net.minecraft.client.gui.overlay.DebygOverlayGui, and its created in net.minecraft.client.gui.IngameGui

Thanks for your help!

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7597

diesieben07

diesieben07    7597

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7597
  • 55115 posts
Posted November 19, 2020

Subscribe to RenderGameOverlayEvent.Text, cancel it and draw your own.

  • Quote

Share this post


Link to post
Share on other sites

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

How do you cancel it? Wouldnt canceling it cancel all text render events?

 

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7597

diesieben07

diesieben07    7597

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7597
  • 55115 posts
Posted November 19, 2020
40 minutes ago, krypciak said:

How do you cancel it?

https://mcforge.readthedocs.io/en/latest/events/intro/

 

40 minutes ago, krypciak said:

Wouldnt canceling it cancel all text render events?

I don't know what you mean by "text render events". The event I mentioned is specifically for the debug screen.

  • Quote

Share this post


Link to post
Share on other sites

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

Thank you! It works.

  • Quote

Share this post


Link to post
Share on other sites

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

Theres one catch. Canceling event works, but the event is running every tick. When I want to show my f3 screen, it doesnt do anything becouse it switches it 20 times per second.

Any ideas?

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7597

diesieben07

diesieben07    7597

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7597
  • 55115 posts
Posted November 19, 2020
11 minutes ago, krypciak said:

Theres one catch. Canceling event works, but the event is running every tick. When I want to show my f3 screen, it doesnt do anything becouse it switches it 20 times per second.

Any ideas?

It fires every frame. If you want to draw something on screen you need to do it every frame, that's how rendering works.

  • Quote

Share this post


Link to post
Share on other sites

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

But i want it to render only when I press f3, and if I press it second time it dissapiers

  • Quote

Share this post


Link to post
Share on other sites

diesieben07    7597

diesieben07

diesieben07    7597

  • Reality Controller
  • diesieben07
  • Forum Team
  • 7597
  • 55115 posts
Posted November 19, 2020
32 minutes ago, krypciak said:

But i want it to render only when I press f3, and if I press it second time it dissapiers

Check GameSettings#showDebugInfo

  • Quote

Share this post


Link to post
Share on other sites

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

It cannot be accessed by GameSettings.showDebugInfo

  • Quote

Share this post


Link to post
Share on other sites

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

I got it by  Minecraft.getInstance().gameSettings.showDebugInfo; works!

Thanks

  • Quote

Share this post


Link to post
Share on other sites

krypciak    0

krypciak

krypciak    0

  • Tree Puncher
  • krypciak
  • Members
  • 0
  • 15 posts
Posted November 19, 2020

End of topic.

  • Quote

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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.

    • Insert image from URL
×
  • Desktop
  • Tablet
  • Phone
Sign in to follow this  
Followers 1
Go To Topic Listing



  • Recently Browsing

    No registered users viewing this page.

  • Posts

    • GenElectrovise
      What is the method to left click?

      By GenElectrovise · Posted 5 minutes ago

      There's probably something in or nearby to PlayerEntity (as a movement controller or something similar?) I'd start with searching my workspace for something along the lines of KeystrokeHandler or PlayerMovementController
    • Luis_ST
      [1.16.5] GameOverlay

      By Luis_ST · Posted 5 minutes ago

      I just want to render a overlay (i have creat a spyglass likt that from 1.17) and now i want to render the Overlay this is the code of the event i used: @SubscribeEvent(priority = EventPriority.HIGHEST) public static void RenderSpyglassOverlay(RenderGameOverlayEvent event) { PlayerEntity player = Minecraft.getInstance().player; int posX = event.getWindow().getScaledWidth() / 2; int posY = event.getWindow().getScaledHeight() / 2; if (player.getActiveItemStack().getItem() == CaveItems.SPYGLASS.get()) { RenderSystem.disableDepthTest(); RenderSystem.depthMask(false); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.disableAlphaTest(); Minecraft.getInstance().getTextureManager().bindTexture(new ResourceLocation("cave:textures/misc/spyglass_scope.png")); Minecraft.getInstance().ingameGUI.blit(event.getMatrixStack(), posX - 128, posY - 128, 0, 0, posX * 2, posY * 2, 256, 256); RenderSystem.depthMask(true); RenderSystem.enableDepthTest(); RenderSystem.enableAlphaTest(); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); } } but the overlay looks like this: https://drive.google.com/file/d/15llZaiIqNWK7WRqcihIJY7oaAszkFKnn/view?usp=sharing so my question: 1 .how to render the game overlay translucent 2. how to set the outside of the overlay to black
    • GenElectrovise
      Server doesnt start

      By GenElectrovise · Posted 10 minutes ago

      Never heard of an error like this but what's your version.
    • Potatoe
      Minecraft server

      By Potatoe · Posted 53 minutes ago

      ok
    • diesieben07
      Minecraft server

      By diesieben07 · Posted 57 minutes ago

      This is a Forum for Forge, I would suggest you seek help elsewhere for Vanilla Minecraft.
  • Topics

    • Gubipe
      5
      What is the method to left click?

      By Gubipe
      Started 14 hours ago

    • Luis_ST
      0
      [1.16.5] GameOverlay

      By Luis_ST
      Started 5 minutes ago

    • BinAufGoogle
      3
      Server doesnt start

      By BinAufGoogle
      Started 18 hours ago

    • Potatoe
      4
      Minecraft server

      By Potatoe
      Started Sunday at 10:13 AM

    • Luis_ST
      4
      [1.16.5] Player Field of View

      By Luis_ST
      Started 2 hours ago

  • Who's Online (See full list)

    • GenElectrovise
    • Yagnap
    • Heliarco
    • hendrik
    • diesieben07
    • HowHow
    • Luis_ST
    • ElpisII
    • Beethoven92
    • zOnlyKroks
    • squidlex
    • RealMrMateo
    • Funyaah
    • loordgek
  • All Activity
  • Home
  • Mod Developer Central
  • Modder Support
  • [1.16.4] Replacing F3 screen
  • Theme

Copyright © 2019 ForgeDevelopment LLC · Ads by Longitude Ads LLC Powered by Invision Community