Hello, how to disallow joining? Like, if(start), dont let join the server, it automatically kicks, who wants to join, only already joined people can be in server? Please answer which event. Thank you. -Wingas
Wingas, give me a minute, I'll see if you can cancel a join event. Wingas, you cannot cancel the event, but you can have them spawn in the dungeon of doom! XD I would have the plugin build a room near bedrock that stores players with a sign to teleport then out that only works when anyone can join. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You could probably find other ways to do it on bukkit, I am sure someone has already made a thread just like this one.
Wingas Looking for one that isn't deprecated disallow @Deprecated public void disallow(PlayerPreLoginEvent.Result result, String message) Deprecated. This method uses a deprecated enum from PlayerPreLoginEvent Disallows the player from logging in, with the given reason Parameters: result - New result for disallowing the player message - Kick message to display to the user See Also: disallow(Result, String) Wingas, As long as you do not use the deprecated enum, you should be okay. I'm not exactly sure why, but one in the API is deprecated and one is not but they both say deprecated. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You can use the PlayerLoginEvent. Use a configuration file to store all players that's online, and then check in the PlayerLoginEvent, the player stored in the configuration file. If it is, then allow him to login else disallow him.