Jump to content

Recommended Posts

Posted

Eya!

I'm trying to do a overlay gui with images (only images, no strings), to do a health bar, like a typical MMORPG overlay gui, but I'm not finding any references on vanilla to do it, so, i would like to know what class to extend, or any vanilla code to check

Posted
  On 6/29/2022 at 6:02 PM, diesieben07 said:
  • Do not store the Minecraft instance in a field. Minecraft is already a singleton.
Expand  

Done, tnxs

 

  On 6/29/2022 at 6:02 PM, diesieben07 said:
  • You need to learn the basics of Java, specifically the difference between static and non-static members.
Expand  

Ya, i know that it needs to be static, but i cant call "blit" method if it's static 

Posted

If it helps, I did something similar recently.

This is the overlay class, implementing IIngameOverlay:

https://github.com/Syrikal/alchemine/blob/main/src/main/java/syric/alchemine/client/VitaSlimeOverlay.java

Here's my overlay registry class, which triggers at the same time I register blocks and items and whatnot:

https://github.com/Syrikal/alchemine/blob/aae585ab7d23fd4be688a60642f200ab09a4fe38/src/main/java/syric/alchemine/setup/AlchemineOverlays.java

And here's where I turn the overlays on and off (it's triggered by RenderFogEvent because it happens concurrently with some fog stuff, but this is a little hacky.)

https://github.com/Syrikal/alchemine/blob/47d9d08a092d3e26441bace8fb5014db0c78c332/src/main/java/syric/alchemine/client/FogEffects.java

  • Thanks 1

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.