1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How can I keep up a max health?

Discussion in 'Help' started by Hoyee, Aug 26, 2020.

  1. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    I set a player's max health. but when I leave the game and reconnect, the max health has removed. how can I keep up it?
     
  2. GodWeedZao

    GodWeedZao Zombie Pigman

    Messages:
    401
    GitHub:
    godweedzao
    set it onJoin
    PHP:
    public function onJoin(PlayerJoinEvent $event) {
    $player->setMaxHealth(40);
    }
    set prefix to solved
     
  3. Hoyee

    Hoyee Baby Zombie

    Messages:
    126
    but I need to set a maxhealth by command or action
     
  4. RicardoMilos384

    RicardoMilos384 Slime

    Messages:
    82
    GitHub:
    ricardomilos384
    You can create a config to store their maxhealth data
    (Sorry for bad English)
     
  5. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    set it again on PlayerJoinEvent
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.