Apollo
Developers
Modules
Waypoint

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.

Waypoint Module Example

Waypoints allow players on your server to know where the action is at!

Integration

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()
        );
    });
}

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)

Removing specific waypoints for a player

public void removeWaypointExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(apolloPlayer -> this.waypointModule.removeWaypoint(apolloPlayer, "KoTH"));
}

Resetting all waypoints for a player

public void resetWaypointsExample(Player viewer) {
    Optional<ApolloPlayer> apolloPlayerOpt = Apollo.getPlayerManager().getPlayer(viewer.getUniqueId());
    apolloPlayerOpt.ifPresent(this.waypointModule::resetWaypoints);
}

Available options

  • SERVER_HANDLES_WAYPOINTS

    • Lets servers handle waypoints.
    • Values
      • Type: Boolean
      • Default: false
  • DEFAULT_WAYPOINTS

    • Sets the default waypoints to send to the player.
    • Values
      • Type: List<Waypoint>
      • Default: Empty List