Save attributes for player

Started by Nosferatu8 on

Topic category: General discussion

Joined Mar 2019
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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?

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
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]