5 minute timer in actionbar

Started by superdiamondsky665 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
5 minute timer in actionbar

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 ?

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Im not sure it's easily…
Wed, 02/16/2022 - 16:18

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)

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Variable Display: Displaying…
Wed, 02/16/2022 - 20:08

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.

Joined Feb 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
alright. thank you ! i'm…
Wed, 02/16/2022 - 20:16

alright. thank you ! i'm gonna try

 

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'm going to send you a…
Wed, 02/16/2022 - 21:05

I'm going to send you a workspace link in a few minutes.

Joined Jun 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Gonna delete it tomorrow, be…
Wed, 02/16/2022 - 21:18

Gonna delete it tomorrow, be quick