Interface ClusterPlayer


public interface ClusterPlayer
Represents a player connected somewhere in the proxy cluster.

Provides read-only identity information (UUID, username, proxy, server) and remote actions (kick, message, move, etc.) that are dispatched to whichever proxy currently owns the player's session.

  • Method Details

    • getUniqueId

      UUID getUniqueId()
      Gets the player's unique identifier.
      Returns:
      the player's UUID
    • getUsername

      String getUsername()
      Gets the player's username.
      Returns:
      the player's username
    • getProxyId

      String getProxyId()
      Gets the identifier of the proxy this player is connected to.
      Returns:
      the proxy identifier
    • getServerName

      @Nullable @Nullable String getServerName()
      Gets the name of the backend server this player is currently on.
      Returns:
      the server name, or null if the player has not yet been sent to a server
    • getIpAddress

      @Nullable @Nullable String getIpAddress()
      Gets the player's IP address.
      Returns:
      the IP address string, or null if unavailable
    • isClientListingAllowed

      boolean isClientListingAllowed()
      Checks whether this player allows themselves to be listed in the tab list for other players.
      Returns:
      true if the player allows client listing
    • kick

      void kick(Component reason)
      Kicks the player from the proxy with the given reason.
      Parameters:
      reason - the kick reason displayed to the player
    • sudo

      void sudo(String command)
      Forces the player to execute a command or send a chat message.
      Parameters:
      command - the command (with or without leading /) or chat message
    • move

      void move(String targetServer)
      Moves the player to the specified backend server.
      Parameters:
      targetServer - the name of the target server
    • transfer

      CompletableFuture<Boolean> transfer(String ip, int port)
      Transfers the player to a different proxy at the given address.
      Parameters:
      ip - the target proxy's IP address
      port - the target proxy's port
      Returns:
      a future that completes with true if the transfer was initiated
    • sendMessage

      void sendMessage(Component message)
      Sends a chat message to the player.
      Parameters:
      message - the message to send
    • queryPing

      CompletableFuture<Long> queryPing()
      Queries the player's current ping latency.
      Returns:
      a future that completes with the player's ping in milliseconds
    • toLocalPlayer

      Optional<? extends Player> toLocalPlayer()
      Attempts to resolve this cluster player to a local Player instance on the current proxy.
      Returns:
      an optional containing the local player, or empty if the player is on a different proxy