Solved Login Events

Discussion in 'Plugin Development' started by WozzSWE, Feb 6, 2016.

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

    WozzSWE

    I just need to know the differences.

    What is the differences between AsyncPlayerLoginEvent, PlayerLoginEvent and PlayerJoinEvent?
     
  2. Offline

    mtrack260

    PlayerJoinEvent = Detects when a player JOINED the server.
    PlayerLoginEvent = Detects when a player is LOGIN INTO (pre-join) the server.
    AsyncPlayerLoginEvent = Detects when a player is LOGIN INTO (pre-join) the server, but, in this case, the event is
    asynchronized, so it does not stop the login event. (I don't know if it works exactly that I explained because I didn't use this event, most part of the Bukkit programmers use the typical PlayerLoginEvent.)

    Hope my answer helps :)

    PS: I'm not a English native speaker so I'm so sorry about the mistakes I have.
     
    WozzSWE likes this.
  3. Offline

    I Al Istannen

    @WozzSWE
    • The PlayerJoinEvent is after the Player has successfully joined the server and wasn't kicked. Here you can set the join message.
    • The PlayerLoginEvent is the Player trying to login and you can still stop that and kick the Player for various reasons. You have access to a Player object by now
    • The AsyncPlayerPreLoginEvent is fired before the player joins the server and before the PlayerLoginEvent. You have just access to the STRING name of the Player, not the Player object itself. I have no idea what this is for though.
     
    WozzSWE and mtrack260 like this.
  4. Offline

    Xerox262

    Good way to load data from a SQL database? If you're using a Ban plugin and you want to load if a player is banned before they actually join.

    Btw you can also get the UUID of the player. https://hub.spigotmc.org/javadocs/s...r/AsyncPlayerPreLoginEvent.html#getUniqueId()
     
    I Al Istannen and WozzSWE like this.
Thread Status:
Not open for further replies.

Share This Page