1. Clean the mess Fix the code formatting, no one would be willing to help someone with a messy code. Looks like you are more likely copy posting code than actually writing it. Remove useless imports, functions and variables. The constructor is useless. 2. Know what you're doing You haven't created a non static function getServer() in your class, neither is the class extending a your class have that function included (the class isn't extending another class, yeah I know). That is an issue that even a beginner would understand. That might be an exaggeration, whoops! let me rephrase that. That is an issue an average English speaker could understand. Seriously, the error literally says it all. "Call to undefined method". getServer() is an undefined method. What do you do when someone tells you to define something, something they probably don't have any idea of? Define it. An error as such doesn't mean you need to panic and Google it up right at that instant. Because, guess what? Errors can be read! Yeah, they aren't like those "An errorhas occurred. Look up code 'MINECRAFTBL4ZEonFire' to find a solution". They are there to assist you. They tell you what's wrong in the simplest of ways (exception to a few, for example the "Unexpected T_PAAMAYIM_NEKUDOTAYIM" error in PHP). 3. Include as less code as possible in your threads This shan't be taken out of context. The imports ("use" statements) were useless. Pretty much everything was. Error tracing doesn't mean you dump the whole class in to your thread and let others figure out the error you're getting. Include only the useful information. "My class extending Listener gives out the following error, could anyone assist me on this? [INSERT ERROR HERE]"
You have quite a few undefined methods. Do you understand how PHP works? If yes, do you understand the concept of OOP (Object Orienented Programming)?