.dev

Modules1 min read

Waypoints

World-anchored markers that live next to the player's own.

waypoint:1Tier A · Decorate

Good for

  • Objectives and capture points
  • Death locations and spawn markers
  • Quest targets that move as the story does

Try it in game, no code

/tehoapi waypoint * rally Rally point

Server waypoints are world-anchored markers that sit in a separate list next to the player's own. They are badged as coming from your server, never saved and never editable by the player, though the player can hide them.

Set one

Java
teho.waypoints().set(Waypoint.builder("objective")
        .name("Capture point B")
        .at(120, 72, -340)
        .dimension("overworld")
        .color(0xFFC24D)
        .focus(true)
        .build());

On Bukkit, start from a Location instead and the position and dimension are filled in for you:

Java
teho.waypoints().set(BukkitTeho.waypoint("spawn", world.getSpawnLocation())
        .name("Spawn")
        .color(0x7CDB8A)
        .build());

Setting the same id again moves or restyles the waypoint.

Remove

Java
teho.waypoints().remove("objective");
teho.waypoints().clear();

active() returns every waypoint you currently have set on that player.

Builder

MethodNotes
builder(id)Required.
name(String)The label on the marker.
at(x, y, z)Block coordinates.
dimension(String)The dimension id, such as overworld, the_nether, the_end or a custom one.
color(rgb)The marker colour.
focus(boolean)Makes it the player's active readout target, so its distance and direction show on the HUD.

Limits

  • 64 waypoints per server.
  • They are cleared when the player leaves, and on every new session.

No code

YAML
death-waypoint: true
Text
/tehoapi waypoint * rally Rally point
/tehoapi unwaypoint * rally

waypoint places the marker at your own position, so it only works on backends.