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

help in the console I get an error on line 112 but I don't know why

Discussion in 'Development' started by Fer45YT, Feb 25, 2021.

  1. Fer45YT

    Fer45YT Creeper

    Messages:
    1
    GitHub:
    Fer45T
    Here is the complete error code but the main one is line 112

    public function onQuit(PlayerQuitEvent $event) {

    $player = $event->getPlayer();
    $player->getArmorInventory()->clearAll();
    $player->setAllowFlight(false);
    $player->setGamemode($this->getServer()->getDefaultGamemode());
    $player->getInventory()->clearAll();
    unset($this->removenpcmode[$player->getName()]);

    if($player->getLevel()->getFolderName() == $this->getConfig()->get("arena")) {
    unset($this->players[$player->getName()]);
    }



    That is the code and the error that marks me is this
    $player->getInventory()->clearAll();
    unset($this->removenpcmode[$player->getName()]);
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
    What error?
     
    minijaham likes this.
  3. Moonafic

    Moonafic Silverfish

    Messages:
    24
    maybe youre unsetting from not existing array
     
  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.