I think you might just be able to use the player connect event then check if the server is full manually and if so kick the player with a custom message. Im not sure that will work but it might.
I think you have to use the player login event and check if the server is full, etc. I currently don't have 0.11.0 beta or PM 1.5.
I just saw your post, I didn't see it, oops. Similar what I just said. I think the correct event is PlayerLoginEvent.
Something like PHP: onPlayerLogin(PlayerLoginEvent $event) { if($this->getServer()->getMaxPlayers() === count($this->plugin->getServer()->getOnlinePlayers())) { $event->setKickMessage("The server is full"); $event->setCancelled(); }}
I think you return it true. PHP: return true; Corrected code. PHP: onPlayerLogin(PlayerLoginEvent $event) { if($this->getServer()->getMaxPlayers() === count($this->plugin->getServer()->getOnlinePlayers())) { $event->setKickMessage("The server is full"); return true; }}
If that were the case you wouldnt need to include return true... Im pretty sure all that does is continue the event normally and if so you dont need that line.
which is as represents 'plugin' on this: if($this->getServer()->getMaxPlayers() === count($this->plugin->getServer()->getOnlinePlayers())) {{ ???
$this->plugin would be used if you were in a second class and if that were the case $this->getServer() would be $this->plugin->getServer()
i got this log [CRITICAL] ClassNotFoundException: "Class TDroidd\CKR\Main not found" (EXCEPTION) in "/src/spl/BaseClassLoader" at line 131
For the billionth time, event handlers don't need to return any values and any return values will be ignored. That comes from the translation in your MCPE client.