Started by
superdiamondsky665
on
Topic category: Help with Minecraft modding (Java Edition)
hello
i would like to make a procedure that displays a 5 minute timer in actionbar, and when the timer ends it kills you.
can someone tell me how to make that please ?
Im not sure it's easily possible in mcreator right now. I coulden't find a way to display variables in an overlay, so I dont think it is intuitively possible. (you could make a bar that decreases over time, but a timer with decreasing numbers isn't possible)
Variable Display:
Displaying variables in an overlay is definitely possible. First, go to the overlay mod element, then make text. Next to the text box (where you can type), there should be an arrow, click that, then scroll down and find until it says <VAR:[Your global variable]>. I think you need to make a global variable first. Then, click the variable that you want, and done! You just need to set the variable to a timer and that's it.
Timer:
First, make a global variable that has an initial value of 6000 ticks, and make it set to PLAYER_LIFETIME, then make a procedure, then in that procedure, the global trigger will be, 'On player tick update' so that every tick the timer will go down by 1. Onto the actual timer, make an if statement. Check if the timer variable is greater than 0. If so, subtract the variable by 1. This will make it so every tick the timer will go down by 1, until it has reached 0. Then make one more if statement, and do, if the timer variable is equal to 0, kill the player. Also make sure the initial variable is set to 6000 ticks, and to PLAYER_LIFETIME. So that every time the player dies, it resets. There might be some extra stuff that I missed.
alright. thank you ! i'm gonna try
I'm going to send you a workspace link in a few minutes.
Boom, have a good day :):
https://drive.google.com/file/d/1SYMf7kUtdsMAl66mEr7a7GyRM98OO3My/view?usp=sharing
Gonna delete it tomorrow, be quick