Called when a player connects to the server. The event is called when
the connection is established. At this time, the player still sees the
loading screen, so if you send a message to the player at that stage, he will
not see it. Instead, you can use the PlayerSpawnEvent.
public PlayerConnectEvent(Player player,
public void setDisconnectReason(java.lang.String reason)
If you cancel the event, the player will be disconnected from the server.
If a "disconnect reason" is set, this reason will be displayed on the
player's screen. By default, no reason is set. If you don't have any
intentions to cancel this event, this method basically does nothing (so
you can ignore it).
reason - the reason why the player was disconnected.
public java.lang.String getDisconnectReason()
Gets the reason why the player will be disconnected. This is only relevant
if a disconnect reason was set by any plugin and the event will be cancelled.
the disconnect reason (if one is set), otherwise an empty
string will be returned.
public boolean isNewPlayer()
Gets whether or not this is a new player, i.e. this is the first time this
player connects to this server.