Started by
Calazacks
on
Topic category: Help with Minecraft modding (Java Edition)
I am trying to make a potion effect that will randomly flash an image (an Overlay?) for about a second. ideally with 4-6 different images that just briefly appear at random while effected. i am not sure how to bind multiple overlays to a potion effect, nor how to make them go away after a short time. is there a procedure to make overlays appear?
I can help you code it if you want unless you are able to do it in MCreator.
hey can u tell me which method u need to override in the overlay's class to do this?
Override a method? Just subscribe to RenderGameOverlayEvent.Pre, or maybe I am not understanding what you mean.
I took some time; wrote up and tested this code (you can condense it I am sure, my excuse is that I am a little tired and rushed lol).
@Calazaks: Keep in mind, you should understand the blit parameters and can change the effects to whatever you want ;D.
Also, before I post this. This code is based on framerate which is very "bad". So to get a consistent "timer" for each player. Subscribe to ClientTickEvent and set NBT variables for the timers and such. If you need more of an explanation/code, I would be thrilled to help you with that. I guess that is it.
Many thanks for the response. Ill try this and see if it works
Great! If you need any help or get any errors, post code please!
To further elaborate as to what i'm trying to make, i'm attempting to make a "Madness" potion effect that has a ton of random things that occur, and i think that strange images randomly appearing almost like a jumpscare would add a bit more appropriate "mental" themes
Absolutely
To extend on my code, it is optimized for 3 images. However, you can append the integers to get more, again if you need help post code or just ask🤗🤗🤗
is this Event called every player tick?
lmao I can't read lol