Package net.minestom.server.event.player
Class AsyncPlayerPreLoginEvent
java.lang.Object
net.minestom.server.event.player.AsyncPlayerPreLoginEvent
- All Implemented Interfaces:
Event
Called before the player initialization, it can be used to kick the player before any connection
or to change his final username/uuid.
-
Constructor Summary
ConstructorDescriptionAsyncPlayerPreLoginEvent
(@NotNull PlayerConnection connection, @NotNull GameProfile gameProfile, @NotNull LoginPluginMessageProcessor pluginMessageProcessor) -
Method Summary
Modifier and TypeMethodDescription@NotNull PlayerConnection
@NotNull UUID
Deprecated.@NotNull String
Deprecated.@NotNull CompletableFuture
<LoginPlugin.Response> sendPluginRequest
(String channel, byte[] requestPayload) Sends a login plugin message request.void
setGameProfile
(GameProfile gameProfile) void
setUsername
(@NotNull String username) Deprecated.
-
Constructor Details
-
AsyncPlayerPreLoginEvent
public AsyncPlayerPreLoginEvent(@NotNull @NotNull PlayerConnection connection, @NotNull @NotNull GameProfile gameProfile, @NotNull @NotNull LoginPluginMessageProcessor pluginMessageProcessor)
-
-
Method Details
-
getConnection
-
getGameProfile
-
setGameProfile
-
sendPluginRequest
@NotNull public @NotNull CompletableFuture<LoginPlugin.Response> sendPluginRequest(String channel, byte[] requestPayload) Sends a login plugin message request. Can be useful to negotiate with modded clients or proxies before moving on to the Configuration state.- Parameters:
channel
- the plugin message channelrequestPayload
- the contents of the plugin message, can be null for empty- Returns:
- a CompletableFuture for the response. The thread on which it completes is asynchronous.
-
getUsername
Deprecated. -
setUsername
Deprecated. -
getPlayerUuid
Deprecated.
-