Waypoint Module
Overview
The waypoint module allows you to interact with the Waypoints mod in Lunar Client.
- Ability to display custom waypoints for players on Lunar Client.
- Set exact location highlights using waypoints.
- Custom colors can be provided.
- Supply a custom name for the waypoint.
- Control the ability to remove the waypoint. (They will always have the option to disable the waypoint, even if you prevent it from being deleted client-side.)
- Control if the waypoint is set to be hidden by default.
Integration
Sample Code
Explore each integration by cycling through each tab, to find the best fit for your requirements and needs.
Displaying a Waypoint
public void displayWaypointExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> {
this.waypointModule.displayWaypoint(apolloPlayer, Waypoint.builder()
.name("KoTH")
.location(ApolloBlockLocation.builder()
.world("world")
.x(500)
.y(100)
.z(500)
.build()
)
.color(Color.ORANGE)
.preventRemoval(false)
.hidden(false)
.build()
);
});
}
Removing a Waypoint
public void removeWaypointExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(apolloPlayer -> this.waypointModule.removeWaypoint(apolloPlayer, "KoTH"));
}
Resetting all Waypoints
public void resetWaypointsExample(Player viewer) {
Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
apolloPlayerOpt.ifPresent(this.waypointModule::resetWaypoints);
}
Waypoint
Options
.name(String)
is the name of the waypoint. Keep in mind this is displayed to players.
.name("KoTH")
.location(ApolloBlockLocation)
is the location of the block the waypoint should display on. See the locations utilities page for more.
.location(ApolloBlockLocation.builder()
.world("world")
.x(500)
.y(100)
.z(500)
.build()
)
.color(java.awt.Color)
is how you dictate the color of the waypoint. See the colors page for more.
Color Types
The java.awt.Color
class statically exposes some colors, although they do not correspond to any existing colors used in Minecraft.
.color(Color.CYAN)
.preventRemoval(String)
sets if the player is able to delete the waypoint client-side.
.preventRemoval(false)
.hidden(Boolean)
if the player is able to see the waypoint or not.
.hidden(false)
Available options
-
SERVER_HANDLES_WAYPOINTS
- Lets servers handle waypoints.
- Values
- Type:
Boolean
- Default:
false
- Type:
-
DEFAULT_WAYPOINTS
- Sets the default waypoints to send to the player.
- Values
- Type:
List<Waypoint>
- Default:
Empty List
- Type:
Automatic Waypoint Creation from Chat
Our Waypoints mod has a built-in feature that allows players to click on coordinates in chat and generate waypoints for those locations, if the coordinates follow specific regex patterns.
Regex Patterns for Waypoint Creation from Chat
The following regex patterns are used to extract coordinates from chat messages. The system will automatically generate waypoints when these patterns match a chat message.
-
Bracket Pattern: Matches coordinates in the format of
"[x, y, z]"
.- Regex:
\\[(?<x>(?:-|)[0-9.]*), (?<y>(?:-|)[0-9.]*), (?<z>(?:-|)[0-9.]*)]
- Chat Example:
[100.5, 64, -200]
- Regex:
-
Title Pattern: Matches coordinates in the format of
"X: x, Y: y, Z: z"
.- Regex:
\\[(?<x>(?:-|)[0-9.]*), (?<y>(?:-|)[0-9.]*), (?<z>(?:-|)[0-9.]*)]
- Chat Example:
X: 123, Y: 65, Z: -320
- Regex: