How to get a local variable from another procedure?

Started by NekoTwT on Thu, 08/20/2020 - 03:34

Topic category: Help with MCreator software

Last seen on 20:06, 15. Sep 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How to get a local variable from another procedure?
Thu, 08/20/2020 - 03:34

so, long story short, i made it so user pushes a button in gui of said block, which then will set a local variable in that button press procedure, and then from the update tick event GET that local variable from said procedure, yes, i know its a LOCAL variable but is there any way to do that or something similar?

Last seen on 20:06, 15. Sep 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
whoops i set this as the…
Thu, 08/20/2020 - 03:40

whoops i set this as the wrong category 

Last seen on 20:06, 15. Sep 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
actually nvm i think it was…
Thu, 08/20/2020 - 03:41

actually nvm i think it was the right category

Last seen on 16:41, 31. Oct 2020
Joined Jul 2018
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
If you want to make it…
Thu, 08/20/2020 - 08:19

If you want to make it within the one block then use the NBT tags. These are like "local variables" but they are stored inside the block. So you can run different procedures for the block and use these NBT tags between them. You can find them in Block procedures bricks.

But if you want to use the variables between different blocks, you have to use global variables. 

Last seen on 20:06, 15. Sep 2020
Joined Aug 2019
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
omg thank you for reminding…
Thu, 08/20/2020 - 15:13

omg thank you for reminding me about nbt because i completely forgot that existed thanks