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

Solved make 20 health to 10

Discussion in 'Development' started by Levi, Oct 25, 2017.

  1. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    When I Do getMaxHealth() and it ends up to be 20 but there's actually 10 heart in game how do i make 20 to 10?
     
  2. KnownUnown

    KnownUnown Spider Jockey Poggit Reviewer

    Messages:
    47
    GitHub:
    knownunown
    From the Minecraft Wiki:
    In other words, each full heart represents 2 health points. That means that a half heart is worth 1 health point. If you really want to turn health into a floating point number, you can simply divide the result by 2, but I'm guessing that's not what you really want.
     
    jasonwynn10 and rektpixel like this.
  3. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    What do you call a half heart if health is an integer?
     
  4. Levi

    Levi Skeleton

    Messages:
    955
    GitHub:
    captainleviftw
    solved
    PHP:
    $player->sendMessage("hearts:> ".$player->getMaxHealth() / 2);
     
  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.