Create Variable with Mcreator in a Procedure

Started by Tethym on

Topic category: Advanced modding

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Create Variable with Mcreator in a Procedure

Hi guys! My Question is how to make a variable with a Procedure Element:

My wish is that I can type a Var-Name in a text fielt in a GUI and create a new Number-Variable with this typed name?

Is this possible in 2020.3 or can it be added in newer versions?

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There's a procedure block …
Tue, 07/28/2020 - 02:32

There's a procedure block (GUI section, one of the last ones) that can obtain the text of a text field value by the ID (name) of the text field.

Once you have the value (your input in that text field), you can use that to create a new NBT tag (closest thing to create a variable) and set the variable name to the input and the value to whatever you need. Once you have it store you could load that NBT in a variable too(GLOBAL, SESSION...), but you would need some code to be able to create variables (not NBT tags) on the fly, variable procedure blocks only allow references to variables that are created using MCreator's GUI.

Hope it helps!

Joined Apr 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hey Sancho, thank you very…
Sun, 08/02/2020 - 20:09

Hey Sancho,

thank you very much for helping me :-)

 

 

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
My pleasure mate! Good luck…
Mon, 08/03/2020 - 05:12

My pleasure mate! Good luck with that modding!