Using local variables in statements

Started by JJ_007 on

Topic category: Help with Minecraft modding (Java Edition)

Active 8 months ago
Joined Apr 2020
Points:
704

User statistics:

  • Modifications: 0
  • Forum topics: 9
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 56
Using local variables in statements

Hey everyone,

I tried to make a procedure to create realistic swinging with a grappling hook or other but after I'd finished, an error occurred, stating 'Statement does not support local variables'.

It's a shame because I can't even test it to see if I'm on the right track.

https://imgur.com/a/Uqa8qvX <-- here's the procedure and the error

If anyone knows a workaround or a solution to this it'd be greatly appreciated!

Active 3 years ago
Joined Jan 2022
Points:
482

User statistics:

  • Modifications: 0
  • Forum topics: 1
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 1
When you are trying to set …
Sun, 01/30/2022 - 10:00

When you are trying to set "varb", "vara" isn't defined or set to any value yet.

Active 7 months ago
Joined Mar 2021
Points:
738

User statistics:

  • Modifications: 0
  • Forum topics: 21
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 113
Local variables doesn't work…
Sun, 01/30/2022 - 10:55

Local variables doesn't work when using server side procedures (e.g. wait procedure block). The only thing I can think of is making a global variable 

Active 8 months ago
Joined Apr 2020
Points:
704

User statistics:

  • Modifications: 0
  • Forum topics: 9
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 56
@P90Ez yeah before putting…
Thu, 03/31/2022 - 12:13

@P90Ez yeah before putting it into Mcreator it works in theory through the use of simultaneous equations being able to find both variables. However you can't do this within Mcreator so I don't really know an alternative