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
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 Summary
ConstructorsConstructorDescriptionServerTransferEvent(@NonNull GeyserConnection connection, @NonNull String host, int port, @NonNull Map<String, byte[]> cookies) -
Method Summary
Modifier and TypeMethodDescription@Nullable StringThe host that the Bedrock player should try and connect to.voidbedrockHost(@NonNull String host) Sets the host for the Bedrock player to be transferred tointThe port that the Bedrock player should try and connect to.voidbedrockPort(@org.checkerframework.common.value.qual.IntRange(from=0L, to=65535L) int port) Sets the port for the Bedrock player to be transferred tocookies()Gets a map of the sessions current cookies.@NonNull Stringhost()The host that the Java server requests a transfer to.intport()The port that the Java server requests a transfer to.Methods inherited from class org.geysermc.geyser.api.event.connection.ConnectionEvent
connection
-
Constructor Details
-
ServerTransferEvent
public ServerTransferEvent(@NonNull GeyserConnection connection, @NonNull String host, int port, @NonNull Map<String, byte[]> cookies)
-
-
Method Details
-
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
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
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
Gets a map of the sessions current cookies.- Returns:
- the connections cookies
-