Jump to content

[1.16.1] [Solved] Custom First Person Block Overlay


EnderUnknown

Recommended Posts

I have been working on a fire-like effect and I would like it to work like fire in the sense that it overlays the player's screen in first person. I have found how Vanilla does it in the OverlayRenderer class but I am unsure of what event to subscribe to for this interaction. It seems as though the RenderBlockOverlayEvent would be the ideal choice, but looking at how it is implemented in the OverlayRenderer class makes me think this is not viable as it only is called if the player is suffocating, burning, or underwater. Any suggestions? 

Thanks!

Link to comment
Share on other sites

Maybe RenderGameOverlayEvent.Post? You could check Minecraft#player there, though you would have to sync your capability to the client for that.

  • Thanks 1

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Link to comment
Share on other sites

46 minutes ago, Novârch said:

Maybe RenderGameOverlayEvent.Post? You could check Minecraft#player there, though you would have to sync your capability to the client for that.

I wasn't able to get it to work with that, but it did prompt me to see where the vanilla renderer renders the overlays and interestingly enough, it is in the renderHand method. So, I was able to use the RenderHandEvent to get it working! Unfortunately, it won't render if the player disables their HUD but since I can't make Vanilla trigger my own event it will have to do. Thanks again!

Link to comment
Share on other sites

  • EnderUnknown changed the title to [1.16.1] [Solved] Custom First Person Block Overlay

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.