Started by
BlockyPenguin
on
Topic category: Help with Minecraft modding (Java Edition)
Hi!
So I' making a mod where, when you right click on a block, the GUI opens. What I need is for the block to be able to get the text inputted from the GUI, and store it, either in an item given to the player, or in the block itself. Please bear in mind that the text may contains spaces and new lines. Is there any way of doing this?
TIA,
~Blocky
I don't think it is possible yet :(
Aww ok. :( Thanks for saying though.
No prob
I think you can, actually. You can store the text input dependency then turn it into a string variable. But I don't know if are there nbt string variables too...
@RaolTheBest No, not as far as I'm aware...
An string variable is now possible, i think.
Currently in MCreator 2020.2 it is possible to do so, recently I did a similar test, and as now there is also a NBT tag for text, it is easy to store both in blocks and in items, the problem is that in the GUI you do not have the option to read the NBT tag text in case you need to display it in the GUI, however you can store the TextField text in an NBT text tag and even convert it to a number if you need to
Anyway, I did a simple procedure that takes the value of the string in the TextField and sends this value in the chat, the only way I managed to make it work is through a button that makes the middle of saving the value of the TextField in the NBT tag