This Is my Main Plugin PHP: <?phpnamespace Chaostix;use Chaostix\commands\Commands;use Chaostix\providers\Auth\EventListener;use pocketmine\network\mcpe\protocol\AddEntityPacket;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\plugin\PluginBase;use pocketmine\event\Listener;use pocketmine\Player;use Chaostix\providers\Auth;class Main extends PluginBase implements Listener{ public $player = ""; public $rpg; private $msg; public $commands; protected $messages = []; public $cfg; private $auth; public $playerKill; public function __construct() { $this->listener = new EventListener(); $this->auth = new Auth(); } public function onEnable() { $this->saveDefaultConfig(); $this->reloadConfig(); $this->getServer()->getPluginManager()->registerEvents($this->listener, $this); $this->auth->Do(); $this->saveDefaultConfig(); } and This is my Auth file PHP: <?phpnamespace Chaostix\providers;use Chaostix\providers\EventListener;use pocketmine\command\Command;use pocketmine\command\CommandSender;use pocketmine\IPlayer;use pocketmine\utils\Config;use pocketmine\permission\PermissionAttachment;use pocketmine\permission\Permission;use pocketmine\Player;use pocketmine\Server;use pocketmine\plugin\PluginBase;use pocketmine\utils\TextFormat;use Chaostix\events\Auth\AuthEvent;use Chaostix\events\Auth\DeAuth;class Auth extends PluginBase{ protected $needAuth = []; protected $listener; protected $provider; protected $blockPlayers = 6; protected $blockSessions = []; protected $messages = []; protected $messageTask = null; public function Do(){ $this->saveResource("messages.yml", false); $messages = (new Config($this->getDataFolder() . "messages.yml"))->getAll(); $this->messages = $this->parseMessages($messages); $registerCommand = $this->getCommand("sm"); $registerCommand->setUsage("/sm {argument}"); $registerCommand->setDescription("AUTH"); $registerCommand->setPermissionMessage("TEST"); $provider = new YAMLDataProvider($this); $this->provider = $provider; foreach($this->getServer()->getOnlinePlayers() as $player){ $this->DeAuth($player); } }
i've already edited it on my plugins. i thought if i extend pluginbase, i can use getServer() method. i was wrong