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

Solved Remove Health

Discussion in 'Development' started by JarguarLoveMC, Dec 9, 2018.

  1. JarguarLoveMC

    JarguarLoveMC Spider Jockey

    Messages:
    49
    how to remove health from player?
     
  2. Mintical

    Mintical Creeper

    Messages:
    5
    GitHub:
    minticalcode
    PHP:
    $sender->setHealth($sender->getHealth() - 1);
    Try that (you can change the 1)
     
    Last edited: Dec 10, 2018
  3. JarguarLoveMC

    JarguarLoveMC Spider Jockey

    Messages:
    49
    10.12 02:37:32 [Server] Server thread/CRITICAL Could not pass event 'pocketmine\event\block\BlockPlaceEvent' to 'SpawnerLevel v1.0.0': Undefined variable: getHealth on SpawnerLevel\Main
     
  4. Mintical

    Mintical Creeper

    Messages:
    5
    GitHub:
    minticalcode
    Remove the $ from getHealth
     
  5. JarguarLoveMC

    JarguarLoveMC Spider Jockey

    Messages:
    49
    $player->setHealth($player->getHealth() - 1);
     
  6. Mintical

    Mintical Creeper

    Messages:
    5
    GitHub:
    minticalcode
    yessir
     
    JarguarLoveMC likes this.
  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.