Can't get Player Persistent Variables to work in multiplayer

Started by TheoTrickser on Sun, 02/28/2021 - 10:28

Topic category: Help with MCreator software

Last seen on 12:24, 3. Apr 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
Can't get Player Persistent Variables to work in multiplayer
Sun, 02/28/2021 - 10:28

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 12:24, 3. Apr 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
The Image does not seem to…
Sun, 02/28/2021 - 10:30

The Image does not seem to be working, so here's the link: https://imgur.com/a/3jhCde5

Last seen on 10:30, 14. Apr 2021
Joined Aug 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 12:24, 3. Apr 2021
Joined Feb 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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.