Posted May 11, 20187 yr I'm trying to do something like what poison and wither do. They change hearths appearance. I really can't find how minecraft does that.
May 11, 20187 yr You can see how minecraft does that in net.minecraftforge.client.GuiIngameForge#renderHealth. Basically the withered/poisoned hearts are a part of the hud texture and MC just changes the uvs when it detects a certain potion effect active. If you want to replicate that effect you would need to use a RenderGameOverlayEvent to cancel the default hearts rendering when you need it and render your hearts with a different texture.
May 29, 20187 yr Author On 5/11/2018 at 12:38 PM, V0idWa1k3r said: You can see how minecraft does that in net.minecraftforge.client.GuiIngameForge#renderHealth. Basically the withered/poisoned hearts are a part of the hud texture and MC just changes the uvs when it detects a certain potion effect active. If you want to replicate that effect you would need to use a RenderGameOverlayEvent to cancel the default hearts rendering when you need it and render your hearts with a different texture. How do I use the rendering functions in the Event?
May 29, 20187 yr Author So I must rewrite them? The GUI functions (e.g. drawTextureModal) are not static.
May 29, 20187 yr You could. Or you could use BufferBuilder directly. These are static: Gui#drawScaledCustomSizeModalRect Gui#drawModalRectWithCustomSizedTexture
May 31, 20187 yr Author Ok managed to make it. Now the only problem is updateCounter that is a timer decremented every tick. Sadly the RenderGameOverlayEvent is called every frame. How I can get this timer working with ticks instead of frames?
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.