Class PreJoinEvent
java.lang.Object
com.welcome234.pluginsystem.events.PreJoinEvent
Called when a player connects to the server
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept()Allows the connection to the servervoidDenies the connection to the server with the specified reasonGets the IP address this player is joining withGets the reason why the connection was denied to the server, or empty string if allowedintgetPort()Gets the port this player is joining withGets the username this player is joining with
-
Constructor Details
-
PreJoinEvent
-
-
Method Details
-
getUsername
Gets the username this player is joining with- Returns:
- Player username
-
getAddress
Gets the IP address this player is joining with- Returns:
- IP address
-
getPort
public int getPort()Gets the port this player is joining with- Returns:
- Port number
-
getDeniedMessage
Gets the reason why the connection was denied to the server, or empty string if allowed- Returns:
- Deny reason
-
accept
public void accept()Allows the connection to the server -
deny
Denies the connection to the server with the specified reason- Parameters:
denyMessage- Deny reason- Throws:
IllegalArgumentException- if denyMessage is null
-