Class PreTransferEvent
java.lang.Object
com.velocitypowered.api.event.connection.PreTransferEvent
- All Implemented Interfaces:
ResultedEvent<PreTransferEvent.TransferResult>
@AwaitingEvent
@Experimental
public final class PreTransferEvent
extends Object
implements ResultedEvent<PreTransferEvent.TransferResult>
This event is executed before sending a player to another host,
either by the backend server or by a plugin using
the
Player.transferToHost(InetSocketAddress) method.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTransfer Result of a player to another host.Nested classes/interfaces inherited from interface com.velocitypowered.api.event.ResultedEvent
ResultedEvent.ComponentResult, ResultedEvent.GenericResult, ResultedEvent.Result -
Constructor Summary
ConstructorsConstructorDescriptionPreTransferEvent(Player player, InetSocketAddress address) Constructs a new PreTransferEvent. -
Method Summary
Modifier and TypeMethodDescriptionReturns the result associated with this event.Returns the original target address the player is attempting to connect to.player()Returns the player attempting to transfer.voidSets the result of this event.
-
Constructor Details
-
PreTransferEvent
Constructs a new PreTransferEvent.- Parameters:
player- the player being transferredaddress- the destination address
-
-
Method Details
-
player
Returns the player attempting to transfer.- Returns:
- the player
-
originalAddress
Returns the original target address the player is attempting to connect to.- Returns:
- the original address
-
getResult
Description copied from interface:ResultedEventReturns the result associated with this event.- Specified by:
getResultin interfaceResultedEvent<PreTransferEvent.TransferResult>- Returns:
- the result of this event
-
setResult
Description copied from interface:ResultedEventSets the result of this event. The result must be non-null.- Specified by:
setResultin interfaceResultedEvent<PreTransferEvent.TransferResult>- Parameters:
result- the new result
-