Started by
Tethym
on
Topic category: Advanced modding
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?
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!
Hey Sancho,
thank you very much for helping me :-)
My pleasure mate! Good luck with that modding!