Using local variables in statements

Started by JJ_007 on

Topic category: Help with modding (Java Edition)

Last seen on 04:49, 30. Jul 2024
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!

Last seen on 13:03, 2. Feb 2022
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.

Last seen on 11:43, 29. Mar 2024
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 

Last seen on 04:49, 30. Jul 2024
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