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

Can fix m'y error

Discussion in 'Development' started by armagadon159753, Sep 4, 2017.

  1. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
    isssu
    https://pastebin.com/QHbAgfSw
    Config:
    https://pastebin.com/w2Hd860U
    ```
    2017-09-04 [06:33:21] [Server thread/CRITICAL]: "Could not pass event 'pocketmine\event\entity\ProjectileHitEvent' to 'Grenade v1.0.0': Call to a member function get() on null on arma\Grenade
    2017-09-04 [06:33:21] [Server thread/CRITICAL]: Error: "Call to a member function get() on null" (EXCEPTION) in "/plugins/Grenade-master/src/arma/Grenade" at line 26
    ```

    Thx for all have a Nice day
     
    Last edited: Sep 4, 2017
  2. XdmingXD

    XdmingXD Baby Zombie

    Messages:
    158
    GitHub:
    xdmingxd
    We don't know about your config
     
    armagadon159753 likes this.
  3. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
  4. LCraftPE

    LCraftPE Silverfish

    Messages:
    20
    GitHub:
    LCraftPE
    Hello,
    The error explains that $this-> getConfig() return null (https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/plugin/PluginBase.php#L242). Looking at the function in the class PluginBase, we can see that this issue exists because you did not set $this->config. So, you must put in your main code:
    PHP:
    $this->config = new Config(...); // Your config
    Moreover, I noticed that you set 4 arguments for the creation of the object $explosion but the constructive function of the class Explosion requires only 3 arguments (https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/level/Explosion.php#L58).
    Keep me informed.
     
    armagadon159753 likes this.
  5. armagadon159753

    armagadon159753 Zombie

    Messages:
    217
    GitHub:
    armagadon159753
    Thx ^~^
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    typo on line 26 https://pastebin.com/QHbAgfSw
    missing parentheses
    Also, this forum doesn't support PM spoons. ThrownExpBottle isn't in PocketMine-MP unless you are using a spoon
     
    Last edited: Sep 4, 2017
  7. LCraftPE

    LCraftPE Silverfish

    Messages:
    20
    GitHub:
    LCraftPE
    Re,
    Yes, it seems like that a parenthesis is missing at line 26 (more precisely on the function getConfig()), maybe the error came from that?
    Keep me informed.
     
  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.