alternatives "get text inside textfield"

Started by 151chit on

Topic category: Help with modding (Java Edition)

Last seen on 07:42, 17. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
alternatives "get text inside textfield"

What can be used instead of "get text inside textfield" on the server so that you can use the text typed in a text field in procedures on the server? since when you try to get text from a text field in a gui open on the server, this variable returns an empty value, how can I fix this?

Last seen on 07:42, 17. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Please delete this topic…
Fri, 05/31/2024 - 15:35

Please delete this topic because I already found a solution

Last seen on 19:01, 15. Jul 2024
Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Would you mind sharing the…
Sat, 06/01/2024 - 22:16

Would you mind sharing the solution?

Last seen on 07:42, 17. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I have already written a…
Sun, 06/02/2024 - 18:34

I have already written a plugin for this https://mcreator.net/plugin/107077/text-fields-synchronizer, on 1.20.1 forge and 1.20.4 neoforge on mcreator 2024.1, it supports all kinds of procedures or there is a manual manual for 1.20. 4 neoforge https://mcreator.net/forum/106498/tutorial-synchronizing-text-fields-se…. I'm sending textbox data from the client to the server using textbox.getValue() and standard built-in mcreator network packages for buttons, slots, etc.

Last seen on 19:01, 15. Jul 2024
Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You are a wonderful human…
Sun, 06/02/2024 - 18:50

You are a wonderful human being thank you!

Last seen on 07:42, 17. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
versions 1.20.1 for 2023.4…
Sun, 06/02/2024 - 18:54

versions 1.20.1 for 2023.4 will work, but I don’t have 2023.4 for testing and I can’t guarantee it will work and post the plugin for 2023.4, in short, to the lines TesttriggerMod.PACKET_HANDLER.sendToServer(new Sync2ButtonMessage(0, x, y, z, textstate. getValue() ));
 Sync2ButtonMessage.handleButtonAction(entity, 0, x, y, z, textstate.getValue()); a new text dependency of the test is added from the text field and sent to the network packet where in the network packet, by analogy with int, string processing is added, for example buffer.readInt(); buffer.readUtf();
private final int x ,y ,z
private final String textfieldtext and so on, if you do it manually, I think you will understand it yourself, everything is obvious there.
A custom text dependency is also sent to the procedure for text processing

 

Last seen on 07:42, 17. Jul 2024
Joined Jan 2024
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
you can unzip my plugin as a…
Sun, 06/02/2024 - 19:00

you can unzip my plugin as a zip archive and look at the code templates, although the implementation there will be different, because to automate the process I used a hash map into which the values ​​of all text fields and their names are cyclically placed using freemaker and then this is sent as one dependency to network package, it uses custom methods to write and read from the hash map buffer, then this hash map is merged with the vanilla guistate hash map and a new procedure block (ternary operator) reads its values, for procedures called by slots there is a similar process, and for each tick the network layout mcreator package is placed in the container class (or <Name >Menu ) and is called every tick by the client containerTick method