Why doesn't wait work with variables?

Started by Withie The Cryptid on

Topic category: Feature requests and ideas for MCreator

Joined Nov 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Why doesn't wait work with variables?

I really feel like wait ___ ticks should work with variables. It's just too restrictive for it to not work.

It doesn't work with LOCAL…
Thu, 01/26/2023 - 08:24

It doesn't work with LOCAL variables because of how programming works. However, global variables do work in it.

Joined Oct 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Local variables only work in…
Wed, 03/08/2023 - 21:39

Local variables only work in the current run of code, afterwards they are reset. This is a feature many programming languages have.

For any values you need to keep, use NBT, scoreboards, or global variables.