Interface PlayerLocator
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Service for resolving which server a player is currently connected to within
the bridge network.
A PlayerLocator is available only on the Velocity proxy. Obtain an
instance via
CommandBridgeAPI.playerLocator(). On
backend servers, that method returns Optional.empty().
To resolve a player's current server:
locator.locate(playerUUID).ifPresent(target ->
Log.info("Player is on server: {}", target.id()));
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionResolves the server a player is currently connected to.
-
Method Details
-
locate
Resolves the server a player is currently connected to.- Parameters:
player- the UUID of the player to locate- Returns:
- an
Optionalcontaining thePlatform.ServerTargetof the server the player is connected to, or an emptyOptionalif the player is offline or their location is unknown - See Also:
-