Disallow join

Discussion in 'Plugin Development' started by Wingas, Sep 6, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Wingas

    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
     
  2. Offline

    Tecno_Wizard

    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.
     
    Last edited by a moderator: Jun 14, 2016
  3. Offline

    Wingas

  4. Offline

    Tecno_Wizard

    Wingas, checking that now.
     
  5. Offline

    Aephout14

    You could probably find other ways to do it on bukkit, I am sure someone has already made a thread just like this one.
     
  6. Offline

    Tecno_Wizard

    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.
     
    Last edited by a moderator: Jun 14, 2016
  7. Offline

    Wingas

    Anyone more? dont work still..
     
  8. Offline

    Unica

    Wingas
    Can't you just kick the player :eek:?
    Or did I went full retard?
     
  9. Offline

    Wingas

  10. Offline

    Ozeir

    Bump every 24hours
     
  11. Offline

    Funergy

    Wingas Whats the problem? Does the PlayerLoginEvent not work?
     
  12. Offline

    Deleted user

  13. Offline

    Rmarmorstein

  14. Offline

    DusRonald

    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.
     
  15. Offline

    SmooshCakez

    Also known as whitelist.
    Registered your events? @EventHandler?
     
  16. Offline

    DusRonald

    Yes it is sort of whitelist.
     
Thread Status:
Not open for further replies.

Share This Page