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

I have serious problem

Discussion in 'Development' started by CookieCode, Aug 16, 2018.

  1. CookieCode

    CookieCode Silverfish

    Messages:
    20
    GitHub:
    CookieCode
    Hello, i have published a Health viewer plugin two years ago, so far I was successful to update it but not for the new 4.0.0 API, can you help me ? I have this error on my console :
    Code:
    [08:23:02] [Server thread/CRITICAL]: [HealthOverHead] Could not execute task CookieCode\HealthOverHead\HealthTask: Call to undefined method CookieCode\HealthOverHead\HealthTask::getOwner()
    [08:23:02] [Server thread/CRITICAL]: Error: "Call to undefined method CookieCode\HealthOverHead\HealthTask::getOwner()" (EXCEPTION) in "plugins/HealthOverHead-master/src/CookieCode/HealthOverHead/HealthTask" at line 27
    
    Can you help me to update it ?
     
  2. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Replace getOwner() with plugin or add the code bellow:
    PHP:
        public function getOwner() : Main{
            return 
    $this->plugin;
        }
     
    Flupko likes this.
  3. CookieCode

    CookieCode Silverfish

    Messages:
    20
    GitHub:
    CookieCode
    Thank you !
     
  4. CookieCode

    CookieCode Silverfish

    Messages:
    20
    GitHub:
    CookieCode
    The problem isn't fixed, won't appear the health bar.[​IMG] [​IMG]
     
  5. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Any error in the console? Please note there is a nametag bug that came on the 1.5. If there are no errors, then it means you fixed the plugin but you are facing this bug. Here is a function that was recently added and would work as a health bar: https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/entity/Entity.php#L615-L617

    EDIT: There is no need to set the player's name on the score tag!
     
  6. CookieCode

    CookieCode Silverfish

    Messages:
    20
    GitHub:
    CookieCode
    No i don't have error in the console...
     
  7. shabzz102

    shabzz102 Spider

    Messages:
    9
    GitHub:
    shabzz102
    Oof gl fixing it
     
  8. MalakasPlayzMCPE

    MalakasPlayzMCPE Zombie Pigman

    Messages:
    667
    Ok, use the setScoreTag() function.
     
  9. Thunder33345

    Thunder33345 Moderator Staff Member

    Messages:
    2,137
    GitHub:
    Thunder33345
    Please use a more informative title

    please note that API v4 is not supported or meant to be used unless you are actively developing PMMP
    the nametag wont update unless player relog because of mojang issues, as it will not to listen to player name update unless you are on a partnered server
     
    HimbeersaftLP, Awzaw and Sandertv like 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.