Started by
VQuip
on
Topic category: Help with Minecraft modding (Java Edition)
I am making a mod with different types of toxins/poisons and I want to add custom heart textures/overlay to the player when the effect is applied but I do not know how to.
Thanks in Advance
Try putting hearts images in an overlay in a way that will cover the Minecraft hearts.
Make each half heart appear and disappear based on the amount of hp you have.
Give it a condition if you have the effect you want, then it returns true and shows it to the players covering the hearts.
Im not sure if I just implemented something incorrect but the overlay is being buggy, any possible solutions?
https://imgur.com/0hj9Dzm
https://imgur.com/a/9cBADgq
Overlays dont seem to respect the clients guy scale, they dont keep their relative position. I dont have any Idea to work around this
Unless they make a new mod element for new types of damage/hearts, I don't think its possible to create a new heart texture without using code. You would have to change the Minecraft health elements.
It's offsetted because there is a bug in Mcreator. Apparently, this only works if your GUI scale is the default zoomed in scale.
I've tried the overlay thing but it seems that the heart bar is displayed with the highest priority always, even if the overlay is set to highest, idk if that's a bug
Overlays don't change relative position; I'm pretty sure the healthbar is dealt with separately, I haven't been able to override it, and any other attempts to modify it don't work with relative positioning, the scale of the GUI changes based on resolution. There may be a method though, I've seen it done with other mods. (Mostly fabric though. I'll look into it.)