Class OutgoingTransferEvent
java.lang.Object
net.minestom.server.event.player.OutgoingTransferEvent
- All Implemented Interfaces:
Event, CancellableEvent, EntityEvent, PlayerEvent
Called when a
It can be canceled to prevent the transfer from occurring.
Player is about to be redirected to another server.
It can be canceled to prevent the transfer from occurring.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetHost()Returns the address of the target server that the player will be transferred to.Gets the player.intgetPort()Returns the port of the target server that the player will be transferred to.booleanGets if theEventshould be cancelled or not.voidsetCancelled(boolean cancel) Marks theEventas cancelled or not.voidChanges the address of the target server that the player will be transferred to.voidsetPort(int port) Changes the port of the target server that the player will be transferred to.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface PlayerEvent
getEntity
-
Constructor Details
-
OutgoingTransferEvent
-
-
Method Details
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableEventGets if theEventshould be cancelled or not.- Specified by:
isCancelledin interfaceCancellableEvent- Returns:
- true if the event should be cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableEventMarks theEventas cancelled or not.- Specified by:
setCancelledin interfaceCancellableEvent- Parameters:
cancel- true if the event should be cancelled, false otherwise
-
getPlayer
Description copied from interface:PlayerEventGets the player.- Specified by:
getPlayerin interfacePlayerEvent- Returns:
- the player
-
getHost
Returns the address of the target server that the player will be transferred to.- Returns:
- the target host, usually an IP or domain name
-
getPort
public int getPort()Returns the port of the target server that the player will be transferred to.- Returns:
- the target port
-
setHost
Changes the address of the target server that the player will be transferred to.- Parameters:
host- the address of the target server, usually an IP or domain name
-
setPort
public void setPort(int port) Changes the port of the target server that the player will be transferred to.- Parameters:
port- the target port
-