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

BaseDamage Error

Discussion in 'Help' started by Ayzrix, Mar 7, 2019.

  1. Ayzrix

    Ayzrix Witch

    Messages:
    66
    GitHub:
    Ayzrix
    Code:
    [19:45:02] [Server thread/CRITICAL]: ErrorException: "Use of undefined constant basedamage - assumed 'basedamage' (this will throw an Error in a future version of PHP)" (EXCEPTION) in "plugins/SkyMsg/src/Msg/item/Epee" at line 42
    [19:45:02] [Server thread/DEBUG]: #0 plugins/SkyMsg/src/Msg/item/Epee(42): pocketmine\utils\Utils::errorExceptionHandler(integer 2, string Use of undefined constant basedamage - assumed 'basedamage' (this will throw an Error in a future version of PHP), string /home/Faction2/plugins/SkyMsg/src/Msg/item/Epee.php, integer 42, array Array())
    PHP:
    public function getDamage($event $playerint $basedamage )
        {
            
    $event->setModifier($basedamage,14);

    Someone can help me for fix this error ? ??
     
  2. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    I don't think that error and the code you provided correlate, or maybe you've fixed the error yourself. The code is fine.
    My assumption is you didn't have a "$" before your "basedamage" initially, which made PHP render it as a global constant.
     
    Last edited: Mar 7, 2019
    MalakasPlayzMCPE likes this.
  3. Ayzrix

    Ayzrix Witch

    Messages:
    66
    GitHub:
    Ayzrix
    Yes but how to defined the variable $basedamage? on a event EntityDamageByEntity
     
  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.