Class ServerTransferEvent

java.lang.Object
org.geysermc.geyser.api.event.connection.ConnectionEvent
org.geysermc.geyser.api.event.java.ServerTransferEvent
All Implemented Interfaces:
org.geysermc.event.Event

public final class ServerTransferEvent extends ConnectionEvent
Fired when the Java server sends a transfer request to a different Java server. Geyser Extensions can listen to this event and set a target server ip/port for Bedrock players to be transferred to.
  • Constructor Details

    • ServerTransferEvent

      public ServerTransferEvent(@NonNull GeyserConnection connection, @NonNull String host, int port, @NonNull Map<String,byte[]> cookies)
  • Method Details

    • host

      public @NonNull String host()
      The host that the Java server requests a transfer to.
      Returns:
      the host
    • port

      public int port()
      The port that the Java server requests a transfer to.
      Returns:
      the port
    • bedrockHost

      public @Nullable String bedrockHost()
      The host that the Bedrock player should try and connect to. If this is not set, the Bedrock player will just be disconnected.
      Returns:
      the host where the Bedrock client will be transferred to, or null if not set.
    • bedrockPort

      public int bedrockPort()
      The port that the Bedrock player should try and connect to. If this is not set, the Bedrock player will just be disconnected.
      Returns:
      the port where the Bedrock client will be transferred to, or -1 if not set.
    • bedrockHost

      public void bedrockHost(@NonNull String host)
      Sets the host for the Bedrock player to be transferred to
    • bedrockPort

      public void bedrockPort(@org.checkerframework.common.value.qual.IntRange(from=0L, to=65535L) int port)
      Sets the port for the Bedrock player to be transferred to
    • cookies

      public @NonNull Map<String,byte[]> cookies()
      Gets a map of the sessions current cookies.
      Returns:
      the connections cookies