Class GameProfileRequestEvent
java.lang.Object
com.velocitypowered.api.event.player.GameProfileRequestEvent
This event is fired after the
PreLoginEvent in
order to set up the game profile for the user. This can be used to configure a custom profile for
a user, i.e. skin replacement.
Velocity will wait for this event to finish firing before proceeding with the rest of the login process, but you should try to limit the work done in any event that fires during the login process.
-
Constructor Summary
ConstructorsConstructorDescriptionGameProfileRequestEvent(InboundConnection connection, GameProfile originalProfile, boolean onlineMode) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionReturns the inbound connection from the player attempting to log in.Returns the game profile that will be used to initialize the connection with.Returns the original game profile before any plugin customization.Returns the username associated with the original game profile.booleanReturns whether the player is connecting in online mode.voidsetGameProfile(@Nullable GameProfile gameProfile) Sets the game profile to use for this connection.toString()
-
Constructor Details
-
GameProfileRequestEvent
public GameProfileRequestEvent(InboundConnection connection, GameProfile originalProfile, boolean onlineMode) Creates a new instance.- Parameters:
connection- the connection connecting to the proxyoriginalProfile- the originalGameProfilefor the useronlineMode- whether or not the user connected in online or offline mode
-
-
Method Details
-
getConnection
Returns the inbound connection from the player attempting to log in.- Returns:
- the inbound connection
-
getUsername
Returns the username associated with the original game profile.- Returns:
- the username
-
getOriginalProfile
Returns the original game profile before any plugin customization.- Returns:
- the original
GameProfile
-
isOnlineMode
public boolean isOnlineMode()Returns whether the player is connecting in online mode.- Returns:
trueif the connection is in online mode, otherwisefalse
-
getGameProfile
Returns the game profile that will be used to initialize the connection with. Should no profile be currently specified, the one generated by the proxy (for offline mode) or retrieved from the Mojang session servers (for online mode) will be returned instead.- Returns:
- the user's
GameProfile
-
setGameProfile
Sets the game profile to use for this connection.- Parameters:
gameProfile- the profile for this connection,nulluses the original profile
-
toString
-