Class OutgoingTransferEvent

java.lang.Object
net.minestom.server.event.player.OutgoingTransferEvent
All Implemented Interfaces:
Event, CancellableEvent, EntityEvent, PlayerEvent

public class OutgoingTransferEvent extends Object implements PlayerEvent, CancellableEvent
Called when a Player is about to be redirected to another server.
It can be canceled to prevent the transfer from occurring.
  • Constructor Details

    • OutgoingTransferEvent

      public OutgoingTransferEvent(Player player, String host, int port)
  • Method Details

    • isCancelled

      public boolean isCancelled()
      Description copied from interface: CancellableEvent
      Gets if the Event should be cancelled or not.
      Specified by:
      isCancelled in interface CancellableEvent
      Returns:
      true if the event should be cancelled
    • setCancelled

      public void setCancelled(boolean cancel)
      Description copied from interface: CancellableEvent
      Marks the Event as cancelled or not.
      Specified by:
      setCancelled in interface CancellableEvent
      Parameters:
      cancel - true if the event should be cancelled, false otherwise
    • getPlayer

      public Player getPlayer()
      Description copied from interface: PlayerEvent
      Gets the player.
      Specified by:
      getPlayer in interface PlayerEvent
      Returns:
      the player
    • getHost

      public String 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

      public void setHost(String host)
      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