[Solved] Help with Variables on servers (Player specific (keep after death))

Started by woodcraft on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[Solved] Help with Variables on servers (Player specific (keep after death))
Sun, 02/28/2021 - 19:31 (edited)

Heya! I've been looking around and i have found threds that seem to explain it but i still don't get it...

All i want is to have a button from a gui set an Int value from 0 to 1 (false/true).

Like a vampire mod for an example i want only the people who has been "infected" to burn in daylight aka (int 1) and (int 0) to not be affected at all.

I have been told by these threds that Global_Sessions in player specific and to use NBT_Tag to store the data when login in and out.

The issue however is that it still wont work... If one becomes a "Vampire" everyone becomes Vampires so i suppose i dont know how to store NBT_Tags of entities. 

If anyone could share pictures or take me through a step by stop guide i would be really greatefull!

Edited by woodcraft on Sun, 02/28/2021 - 19:31
Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Use Player Persistent global…
Tue, 02/23/2021 - 23:17

Use Player Persistent global variable! It's unique for all players on the server and will not reset after rejoining.

There is no need to use Global Session and NBT in this case.

Joined Jan 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Yeah that seems to be the…
Wed, 02/24/2021 - 07:49

Yeah that seems to be the most logical answer but when i log in to my first account and set well something to 1 if i log in to a second account on the same server i get the same effects which must mean that the int value is set to 1 for all players eventhough its Player Persistent...

Joined Sep 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I also need help with this!
Wed, 02/24/2021 - 08:38

I also need help with this!

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Here is a picture of my…
Wed, 02/24/2021 - 12:02

Here is a picture of my function and my Variable is set up like this:

IsMermaid |  NUMBER | PLAYER_PERSISTENT | 0

was

IsMermaid |  NUMBER | GLOBAL_SESSION | 0

same outcome

Joined Apr 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Hm It’s either a bug or your…
Wed, 02/24/2021 - 13:09

Hm It’s either a bug or your fault. What version are you using? Also could you send your workspace?

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I apprear to have solved it…
Wed, 02/24/2021 - 13:30

I apprear to have solved it somehow and i have no clue what i did but now it works but thanks for your help clearing up the confusion between PLAYER_PERSISTENT and GLOBAL_SESSION!