Using local variables in statements

Started by JJ_007 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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!

Joined Jan 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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.

Joined Mar 2021
Points:

User statistics:

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

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
@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