Package com.velocitypowered.api.util
Class ServerLink
java.lang.Object
com.velocitypowered.api.util.ServerLink
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.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionGet the type of the server link.Get the custom component label of the server link.getUrl()Get the linkURI.static ServerLinkserverLink(ServerLink.Type type, String link) Creates aServerLinkwith a built-in type label.static ServerLinkserverLink(Component label, String link) Creates aServerLinkwith a custom component label.
-
Method Details
-
serverLink
Creates aServerLinkwith a custom component label.- Parameters:
label- the Component to display to the userlink- the URL to open when clicked- Returns:
- a
ServerLinkinstance with the given label and URL
-
serverLink
Creates aServerLinkwith a built-in type label.- Parameters:
type- the predefined type of the linklink- the URL to open when clicked- Returns:
- a
ServerLinkinstance with the given type and URL
-
getBuiltInType
Get the type of the server link.- Returns:
- the type of the server link
-
getCustomLabel
Get the custom component label of the server link.- Returns:
- the custom component label of the server link
-
getUrl
Get the linkURI.- Returns:
- the link
URI
-