How to save data from gui to block or item

Started by BlockyPenguin on Sat, 11/02/2019 - 03:35

Topic category: Help with modding

Last seen on 23:44, 7. Jan 2020
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
How to save data from gui to block or item
Sat, 11/02/2019 - 03:35

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

0Upvote this forum topic
Last seen on 15:05, 3. Apr 2020
Joined Jun 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
I don't think it is possible…
Sat, 11/02/2019 - 08:32

I don't think it is possible yet :(

0Upvote this forum topic
Last seen on 23:44, 7. Jan 2020
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
Aww ok. :( Thanks for saying…
Sat, 11/02/2019 - 10:47

Aww ok. :( Thanks for saying though.

0Upvote this forum topic
Last seen on 15:05, 3. Apr 2020
Joined Jun 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
No prob   
Sat, 11/02/2019 - 10:48

No prob 

 

0Upvote this forum topic
Last seen on 20:27, 31. Mar 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
I think you can, actually…
Mon, 11/04/2019 - 16:00

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...

0Upvote this forum topic
Last seen on 23:44, 7. Jan 2020
Joined Sep 2017
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
@RaolTheBest No, not as far…
Fri, 11/08/2019 - 08:49

@RaolTheBest No, not as far as I'm aware...

0Upvote this forum topic
Last seen on 14:35, 2. Apr 2020
Joined Dec 2019
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
An string variable is now…
Thu, 03/26/2020 - 15:19

An string variable is now possible, i think.

0Upvote this forum topic
Last seen on 23:40, 1. Apr 2020
Joined Feb 2016
User points:

User statistics:

  • Modifications:
  • Mods of the week:
  • Forum topics:
  • Comments:
  • Wiki pages:
  • Tracker tickets:
  • Invalid tickets:
Currently in MCreator 2020.2…
Sun, 03/29/2020 - 01:52

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

procedure block

0Upvote this forum topic