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

undefined method error

Discussion in 'Development' started by Nora1903, Jun 19, 2018.

  1. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    i'm trying to get player health using player->getMaxHealth() but i still got this error
    Code:
    Call to undefined method pocketmine\Player::getMaxHeath()
    Code:
    Call to undefined method pocketmine\Player::getHealth()
    are there any wrongs ? please give me a help
     
    Last edited: Jun 19, 2018
  2. Flupko

    Flupko Silverfish

    Messages:
    24
    GitHub:
    Warex
    try with that: $player->setHealth($player->getHealth(20));
     
  3. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
    No, i want to get value of health of a player
     
  4. Nora1903

    Nora1903 Slime

    Messages:
    82
    GitHub:
    cuongvnz
  5. xXNiceAssassinlo YT

    xXNiceAssassinlo YT Zombie Pigman

    Messages:
    499
    GitHub:
    xXNiceYT
    Are u sure beacuse that function is in pmmp
     
  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.