Wait until number variable is randomized

Started by myxical on

Topic category: Help with Minecraft modding (Java Edition)

Active 1 year ago
Joined May 2021
Points:
780

User statistics:

  • Modifications: 0
  • Forum topics: 36
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 83
Wait until number variable is randomized

I have a procedure that has a local number variable. The variable would be set to 0-10 (random 0,1 * 10), and depending on the number rolled a thing will happen. So spawn tnt when number is 1, spawn a parrot when it's 2, etc.

But the number isn't getting rolled. Actually, it is, but after the procedure is finished. Everything is happening at one tick, and that one tick has the number 0 set, only the tick after this one will be rolled. What I would do to fix this is to add "wait 1 tick" block to the rest of the procedure, but that gives me an error that you can't do that on variables. So, how do I fix this?

Active 3 years ago
Joined Jun 2021
Points:
631

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 95
If the event itself is…
Tue, 06/29/2021 - 06:19

If the event itself is triggered by an Entity, Item, or Block you could use custom number NBT tags as a workaround

Active 1 year ago
Joined May 2021
Points:
780

User statistics:

  • Modifications: 0
  • Forum topics: 36
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 83
It's triggered by breaking a…
Tue, 06/29/2021 - 19:07

It's triggered by breaking a block. Like a lucky block, for example.

Active 3 years ago
Joined Jun 2021
Points:
631

User statistics:

  • Modifications: 0
  • Forum topics: 7
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 95
Then you can still call to…
Tue, 06/29/2021 - 20:34

Then you can still call to the block, itll just run on the air left in its place

Active 1 year ago
Joined May 2021
Points:
780

User statistics:

  • Modifications: 0
  • Forum topics: 36
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 83
Yeah but it's not working
Tue, 06/29/2021 - 20:55

Yeah but it's not working