Randomly triggered overlay

Started by kajto359 on

Topic category: Help with modding (Java Edition)

Last seen on 15:45, 1. May 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Randomly triggered overlay

So, im trying to get a overlay to randomly trigger for 1 sec every couple of while, for now i have this:

IF is at biome x y z the end

  Do 
         IF random number between 1 and 5 = 2

           Do

                   Set: Local (boolean var) to true

             Else 

                      Set: local (same var as before) to false

     Else

                Set: local (Same var) to false

Return local (the var from before)

 

 

 

And a procedure that calls every player tick that calls this one every 20 ticks (1 sec)

Last seen on 15:45, 1. May 2024
Joined Mar 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(the global var is player…
Tue, 04/30/2024 - 09:36

(the global var is player persistent)
Other one is:

Set: global: (number var) to global: (same var) + 1

IF

    global: (same var) = 20

      do

            Call the prodecure from before

            Set global: (also the same number var) to 0