Class PlayerConnectionValidateLoginEvent
java.lang.Object
org.bukkit.event.Event
io.papermc.paper.event.connection.PlayerConnectionValidateLoginEvent
Validates whether a player connection is able to log in.
Called when is attempting to log in for the first time, or is finishing up being configured.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorsConstructorDescriptionPlayerConnectionValidateLoginEvent
(PlayerConnection connection, @Nullable Component kickMessage) -
Method Summary
Modifier and TypeMethodDescriptionvoid
allow()
Allows the player to log in.Gets the connection of the player in this event.static HandlerList
Gets the reason for why a player is not allowed to join the server.boolean
Gets if the player is allowed to enter the next stage.void
kickMessage
(Component message) Disallows the player from logging in, with the given reasonMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerConnectionValidateLoginEvent
@Internal public PlayerConnectionValidateLoginEvent(PlayerConnection connection, @Nullable Component kickMessage)
-
-
Method Details
-
getConnection
Gets the connection of the player in this event. Note, the type of this connection is not guaranteed to be stable across versions. Additionally, disconnecting the player through this connection / using any methods that may send packets is not supported.- Returns:
- connection
-
allow
public void allow()Allows the player to log in. This skips any login validation checks. -
kickMessage
Disallows the player from logging in, with the given reason- Parameters:
message
- Kick message to display to the user
-
getKickMessage
Gets the reason for why a player is not allowed to join the server. This will be null in the case that the player is allowed to log in.- Returns:
- disallow reason
-
isAllowed
public boolean isAllowed()Gets if the player is allowed to enter the next stage.- Returns:
- if allowed
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-