Save attributes for player

Started by Nosferatu8 on

Topic category: General discussion

Active 2 months ago
Joined Mar 2019
Points:
841

User statistics:

  • Modifications: 7
  • Forum topics: 11
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 121
Save attributes for player

Hello everyone. Is there a way to save added attributes for players/armors by command? 
Everytime my player dies it's loosing all it's attributes and reseting back to vanilla values. Any solution to this?

Active 1 year ago
Joined Dec 2021
Points:
450

User statistics:

  • Modifications: 0
  • Forum topics: 3
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 20
One idea is to use global…
Sun, 12/26/2021 - 01:08

One idea is to use global variables of the Player _Persistent type to store attribute values. When a player dies or rejoins the server, the attributes are reset. But if you have a MAXHEALTH variable you do the following. When a player is revived or logs into the server: Set attribute max_health to [get global MAXHEALTH]