How to get a local variable from another procedure?

Started by NekoTwT on

Topic category: Help with MCreator software

Last seen on 19:23, 8. Apr 2021
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to get a local variable from another procedure?

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 19:23, 8. Apr 2021
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 19:23, 8. Apr 2021
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 17:21, 27. Apr 2023
Joined Jul 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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 19:23, 8. Apr 2021
Joined Aug 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • 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

Last seen on 03:06, 7. Nov 2021
Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Same lol thanks
Sun, 06/27/2021 - 03:06

Same lol thanks