(Semi-Solved) Setting itemstack variable to itemstack return value of a procedure causes crashing.

Started by baicu12096 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
(Semi-Solved) Setting itemstack variable to itemstack return value of a procedure causes crashing.
Mon, 09/29/2025 - 19:04 (edited)

I am honestly tired of this, I've searched everything and found nothing. Here are the procedures involved.

https://imgur.com/a/0tGWHXn

https://imgur.com/a/pK350tY

Basically, I have a block that extracts different gases based on biome, height, etc.

To avoid making 300 IFELSEs and becoming Yandere Simulator 2, I am using a plugin for arrays.

The problem is, in the procedure ExtractGas, we have this variable called "gas", which I am trying to set it's itemstack value to the return value of the procedure ReturnGas. When I try to do so, this error shows up in the console:

https://gist.github.com/baicu12096/13f7b8527076283d1969266e6ca1298f

 If anyone can tell me what is happening, and possibly how I can fix it, I would appreciate. If it involves the autogenerated code, I will send it in no time. 
 

Edited by baicu12096 on Mon, 09/29/2025 - 19:04
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is the ReturnGas procedure…
Mon, 09/29/2025 - 15:18

Is the ReturnGas procedure the "CheckIfGasIsCompatible" procedure here,

 

if so is the ReturnGas procedure saving correctly?

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah, ReturnGas is the same…
Mon, 09/29/2025 - 16:22

Yeah, ReturnGas is the same as CheckIfGasIsCompatible.

It is saving correctly.

HOWEVER, I had to reload the workspace once because the menu for selecting the procedure in the "call procedure and get return value" was not showing ReturnGas. IDK if that matters.

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
The crash only happens if I…
Mon, 09/29/2025 - 16:23

The crash only happens if I try to emulate Minecraft btw

Debugger doesn't seem to help

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
emulate? Does the generated…
Mon, 09/29/2025 - 16:36

emulate? Does the generated code of CheckIfGasIsCompatible show up?

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I mean when you click the …
Mon, 09/29/2025 - 16:40

I mean when you click the "run client" button

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Does the generated code of…
Mon, 09/29/2025 - 17:11

Does the generated code of CheckIfGasIsCompatible show up?

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
No, it crashes before…
Mon, 09/29/2025 - 17:14

No, it crashes before Minecraft even starts loading, it appears that error message I put in github gist

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
yeah so one of the blocks in…
Mon, 09/29/2025 - 17:28

yeah so one of the blocks in that procedure is causing errors.

This might be hard to debug, you might take all the blocks off and individually readd them to find the problem block.
But maybe we can get something from the logs, go to C:\Users\user\.mcreator\logs\mcreator.log

Joined Mar 2025
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
From what the console is…
Mon, 09/29/2025 - 17:37

From what the console is saying, "CheckIfGasIsCompatibleProcedure.execute(y).copy();" which apparently calls the ReturnGas procedure and gets it's result, is being read as a variable, and since it has not been declared it gives off an error

        gas = CheckIfGasIsCompatibleProcedure.execute(y).copy(); 
              ^ 
  symbol:   variable CheckIfGasIsCompatibleProcedure 
  location: class GasExtractingProcedure
Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
C:\Users\user\.mcreator\logs…
Mon, 09/29/2025 - 17:40

C:\Users\user\.mcreator\logs\mcreator.log

is not the same as the console. It has the logs for stuff that happens in the mcreator program itself

Joined Dec 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
oh well that's annoying it's…
Mon, 09/29/2025 - 17:52

oh well that's annoying it's one of the blocks you have used the most...

was this plugin made for the version you are on? Like you didn't port it yourself, or download one that was "force ported" by someone else.

Can you send a link to it?