Class ServerLink

java.lang.Object
com.velocitypowered.api.util.ServerLink

public final class ServerLink extends Object
Represents a custom URL servers can show in player pause menus. Links can be of a built-in type or use a custom component text label.
  • Method Details

    • serverLink

      public static ServerLink serverLink(Component label, String link)
      Construct a server link with a custom component label.
      Parameters:
      label - a custom component label to display
      link - the URL to open when clicked
    • serverLink

      public static ServerLink serverLink(ServerLink.Type type, String link)
      Construct a server link with a built-in type.
      Parameters:
      type - the built-in type of link
      link - the URL to open when clicked
    • getBuiltInType

      public Optional<ServerLink.Type> getBuiltInType()
      Get the type of the server link.
      Returns:
      the type of the server link
    • getCustomLabel

      public Optional<Component> getCustomLabel()
      Get the custom component label of the server link.
      Returns:
      the custom component label of the server link
    • getUrl

      public URI getUrl()
      Get the link URI.
      Returns:
      the link URI