Class PlayerHandshakeEvent
- All Implemented Interfaces:
Cancellable
If there are no listeners listening to this event, the logic default to your server platform will be run.
WARNING: TAMPERING WITH THIS EVENT CAN BE DANGEROUS
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPlayerHandshakeEvent(String originalHandshake, boolean cancelled) Deprecated.PlayerHandshakeEvent(String originalHandshake, String originalSocketAddressHostname, boolean cancelled) -
Method Summary
Modifier and TypeMethodDescriptionGets the message to display to the client when authentication fails.voidfailMessage(Component failMessage) Sets the message to display to the client when authentication fails.Deprecated.static HandlerListGets the original handshake string.Gets the original socket address hostname.Gets the profile properties.Gets the server hostname string.Gets the socket address hostname string.Gets the unique id.booleanGets the cancellation state of this event.booleanisFailed()Determines if authentication failed.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetFailed(boolean failed) Sets if authentication failed and the client should be disconnected.voidsetFailMessage(String failMessage) Deprecated.voidsetPropertiesJson(String propertiesJson) Sets the profile properties.voidsetServerHostname(String serverHostname) Sets the server hostname string.voidsetSocketAddressHostname(String socketAddressHostname) Sets the socket address hostname string.voidsetUniqueId(UUID uniqueId) Sets the unique id.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerHandshakeEvent
Deprecated. -
PlayerHandshakeEvent
-
-
Method Details
-
getOriginalHandshake
Gets the original handshake string.- Returns:
- the original handshake string
-
getOriginalSocketAddressHostname
Gets the original socket address hostname.This does not include the port.
In cases where this event is manually fired and the plugin wasn't updated yet, the default is
"127.0.0.1".- Returns:
- the original socket address hostname
-
getServerHostname
Gets the server hostname string.This should not include the port.
- Returns:
- the server hostname string
-
setServerHostname
Sets the server hostname string.This should not include the port.
- Parameters:
serverHostname- the server hostname string
-
getSocketAddressHostname
Gets the socket address hostname string.This should not include the port.
- Returns:
- the socket address hostname string
-
setSocketAddressHostname
Sets the socket address hostname string.This should not include the port.
- Parameters:
socketAddressHostname- the socket address hostname string
-
getUniqueId
Gets the unique id.- Returns:
- the unique id
-
setUniqueId
Sets the unique id.- Parameters:
uniqueId- the unique id
-
getPropertiesJson
Gets the profile properties.This should be a valid JSON string.
- Returns:
- the profile properties, as JSON
-
isFailed
public boolean isFailed()Determines if authentication failed.When
true, the client connecting will be disconnected with thefail message.- Returns:
trueif authentication failed,falseotherwise
-
setFailed
public void setFailed(boolean failed) Sets if authentication failed and the client should be disconnected.When
true, the client connecting will be disconnected with thefail message.- Parameters:
failed-trueif authentication failed,falseotherwise
-
setPropertiesJson
Sets the profile properties.This should be a valid JSON string.
- Parameters:
propertiesJson- the profile properties, as JSON
-
failMessage
Gets the message to display to the client when authentication fails.- Returns:
- the message to display to the client
-
failMessage
Sets the message to display to the client when authentication fails.- Parameters:
failMessage- the message to display to the client
-
getFailMessage
Deprecated.usefailMessage()Gets the message to display to the client when authentication fails.- Returns:
- the message to display to the client
-
setFailMessage
Deprecated.Sets the message to display to the client when authentication fails.- Parameters:
failMessage- the message to display to the client
-
isCancelled
public boolean isCancelled()Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other pluginsWhen this event is cancelled, custom handshake logic will not be processed.
- Specified by:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.When this event is cancelled, custom handshake logic will not be processed.
- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-
failMessage()