Can't get Player Persistent Variables to work in multiplayer

Started by TheoTrickser on

Topic category: Help with MCreator software

Last seen on 17:34, 26. Sep 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Can't get Player Persistent Variables to work in multiplayer

So I tried testing my mod one the test server after everything worked fine on the client. I added a GUI that changes Player Persistent Variables when I enter their name and an ability slot, but nothing happens. I am displaying the Variables with an overlay an when I spam the GUI button hard enough, the value of the Variable changes for a few ms, but goes back afterwards. How do I fix that? Here's the procedure:
Procedure Screenshot

Last seen on 04:08, 16. Apr 2024
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
In your procedure you have a…
Tue, 03/02/2021 - 08:16

In your procedure you have a small icon (to the right) on the "Get text inside textfield" block.
This is to say that you the block works only on the client side and not on the server side!

I encountered the same problem, I am looking for a solution, if I find it I share. But java is like my English! Not terrible.

Last seen on 17:34, 26. Sep 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I am actually using a…
Tue, 03/02/2021 - 08:24

I am actually using a workaround right now which works, but isn't perfect at all. Just bind the GUI to an item, save the text field contents into Item NBT Tags and then use their values to change the variables of the current player when he uses it. That should work for now, but it requires opening your inventory after every change made to the NBT Tags or else the values won't apply.