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

Server crash cause of getPlayer()

Discussion in 'Plugin Help' started by GeistFan, Nov 24, 2022.

  1. GeistFan

    GeistFan Slime

    Messages:
    86
    GitHub:
    GeistFan
    Hey I'm again
    I do not know why my Server crashed, i just used getPlayer()
    Heres the error: Call to undefined method ForeverCMD\main::getPlayer()
    Here is the code i think caused the error:
    Code:
        public function onPlayerJoin(PlayerJoinEvent $event)
        {
            $join = $this->getConfig()->get("join");
            $player = $this->getPlayer()->getName();
            $event->setJoinMessage(str_replace("{name}",$player,$join));
        }
        public function onPlayerQuit(PlayerQuitEvent $event)
        {
            $quit = $this->getConfig()->get("leave");
            $player = $this->getPlayer()->getName();
            $event->setQuitMessage(str_replace("{name}",$player,$quit));
        }
     
  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.