This document provides a detailed specification for all public methods in the LocatorBarAPI class and the LocatorBarCondition enum.
Package: dev.mukulx.locatorbarapi
The primary static facade for controlling locator bar waypoints.
- Description: Bootstraps the LocatorBarAPI system. Registers event listeners, injects netty outbound channel handlers for all online players, and starts the background synchronization task.
- Parameters:
hostingPlugin(JavaPlugin): The plugin instance managing the API lifecycle.
- Throws:
NullPointerExceptionifhostingPluginis null.
- Description: Saves persistent state to disk, cancels the background update task, and clears internal references. Call this in
onDisable()if shading the API.
- Description: Saves the current locator bar configuration, active waypoints, and sessions to
locatorbar_state.json.
- Description: Checks whether packet reflection and netty pipeline hooks are available and working on the current server version.
- Returns:
boolean-trueif fully functional,falseotherwise.
- Description: Enables or disables informational console logging from LocatorBarAPI. Pass
falsefor a completely silent, clean server console. Important warnings and critical exceptions will still be reported. - Parameters:
enabled(boolean):trueto enable console logs,falseto silence them.
- Description: Checks whether informational console logging is currently enabled.
- Returns:
boolean-trueif active.
- Description: Retrieves the current background update interval in server ticks. Defaults to
2Lticks (10 Hz). - Returns:
long- Interval in server ticks.
- Description: Configures the background synchronization frequency dynamically at runtime without requiring config files or server restarts.
- Parameters:
ticks(long): The update interval in ticks (must be >= 1).
- Throws:
IllegalArgumentExceptionifticks < 1.
- Description: Immediately untracks all waypoints from the screens of all online players and hides the locator bar for all future joiners.
- Throws:
IllegalStateExceptionif the API has not been initialized.
- Description: Restores locator bar visibility for all online players using managed tracking.
- Throws:
IllegalStateExceptionif the API has not been initialized.
isGlobalHidden()
- Description: Checks whether the global hide state is currently active.
- Returns:
boolean-trueif all players have their locator bars suppressed. - Throws:
IllegalStateExceptionif the API has not been initialized.
- Description: Clears all custom tracking, conditions, and managed sessions across all online players, restoring pure vanilla Minecraft locator bar behavior.
- Throws:
IllegalStateExceptionif the API has not been initialized.
- Description: Checks whether the
locatorBargamerule is enabled in the specified world. - Parameters:
world(World): The world to query.
- Returns:
boolean-trueif enabled. - Throws:
NullPointerExceptionifworldis null.
- Description: Configures the
locatorBargamerule for a specific world. FiresWorldLocatorBarToggleEvent. - Parameters:
world(World): The target world.enabled(boolean):trueto enable,falseto disable.
- Returns:
boolean-trueif successfully applied,falseif cancelled by event. - Throws:
NullPointerExceptionifworldis null.
- Description: Enables the locator bar gamerule for the given world.
- Parameters:
world(World): The world to enable.
- Returns:
boolean-trueif enabled.
- Description: Disables the locator bar gamerule for the given world.
- Parameters:
world(World): The world to disable.
- Returns:
boolean-trueif disabled.
- Description: Hides the locator bar for a specific player immediately. Dispatches untrack packets to clear all active dots from the player's HUD.
- Parameters:
player(Player): The player whose locator bar will be hidden.
- Throws:
NullPointerExceptionifplayeris null.IllegalStateExceptionif the API has not been initialized.
- Description: Shows the locator bar for a specific player using managed tracking.
- Parameters:
player(Player): The player whose locator bar will be shown.
- Throws:
NullPointerExceptionifplayeris null.IllegalStateExceptionif the API has not been initialized.
isHidden(Player player)
- Description: Checks whether the locator bar is currently hidden for the specified player.
- Parameters:
player(Player): The player to check.
- Returns:
boolean-trueif hidden. - Throws:
NullPointerExceptionifplayeris null.IllegalStateExceptionif the API has not been initialized.
- Description: Reverts the specified player to default vanilla behavior, clearing any custom target sets, ranges, or conditions.
- Parameters:
player(Player): The player to reset.
- Throws:
NullPointerExceptionifplayeris null.IllegalStateExceptionif the API has not been initialized.
- Description: Returns the active operating mode name for a player (
HIDDEN,MANAGED, orVANILLA). - Parameters:
viewer(Player): The player to query.
- Returns:
String- Mode name. - Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Configures
holderto see only the specifiedtargetson their locator bar. - Parameters:
holder(Player): The viewer receiving waypoint dots.targets(Player...): One or more target players to display.
- Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Configures
holderto see only the collection oftargetson their locator bar. - Parameters:
holder(Player): The viewer receiving waypoint dots.targets(Collection<Player>): Collection of target players.
- Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Configures
holderto see only the collection oftargetswithin a maximum distance (in blocks). - Parameters:
holder(Player): The viewer.targets(Collection<Player>): Target players to display.range(double): Maximum block distance (use-1for unlimited).
- Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Configures
holderto see only the array oftargetswithin a maximum distance. - Parameters:
holder(Player): The viewer.range(double): Maximum block distance.targets(Player...): Target players.
- Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Clears any specific target restrictions for
holder, returning to displaying all eligible players in managed mode. - Parameters:
holder(Player): The viewer.
- Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Checks whether
holderhas an active custom target filter. - Parameters:
holder(Player): The viewer.
- Returns:
boolean-trueif specific targets are being tracked. - Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Returns the set of players currently configured as targets for
holder. - Parameters:
holder(Player): The viewer.
- Returns:
Set<Player>- Set of target players. - Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Limits the maximum distance at which waypoints will appear for
holder. - Parameters:
holder(Player): The viewer.range(double): Distance in blocks (-1for unlimited).
- Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Gets the current maximum distance limit for
holder. - Parameters:
holder(Player): The viewer.
- Returns:
double- Range in blocks, or-1if unlimited. - Throws:
NullPointerExceptionifholderis null.IllegalStateExceptionif the API has not been initialized.
- Description: Enables or disables a visibility condition for
viewer. When enabled, any player meeting the condition is excluded fromviewer's locator bar. - Parameters:
viewer(Player): The viewer.condition(LocatorBarCondition): Condition to configure.enabled(boolean):trueto hide matching targets,falseto show them.
- Throws:
NullPointerExceptionifviewerorconditionis null.IllegalStateExceptionif the API has not been initialized.
- Description: Configures multiple conditions for
viewerin a single call. - Parameters:
viewer(Player): The viewer.enabled(boolean):trueto hide matching targets,falseto allow them.conditions(LocatorBarCondition...): One or more conditions.
- Throws:
NullPointerExceptionifviewerorconditionsis null.IllegalStateExceptionif the API has not been initialized.
- Description: Convenience method enabling standard stealth conditions (
SNEAKING,INVISIBLE,HEAD_WEARABLE) forviewer. - Parameters:
viewer(Player): The viewer.
- Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Enables the wildcard
ALLcondition forviewer, hiding players matching any supported stealth or state condition. - Parameters:
viewer(Player): The viewer.
- Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Configures the
ALLwildcard condition on or off forviewer. - Parameters:
viewer(Player): The viewer.enabled(boolean):trueto enable,falseto disable.
- Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Clears all active condition filters for
viewer. - Parameters:
viewer(Player): The viewer.
- Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Returns the set of all conditions currently enabled for
viewer. - Parameters:
viewer(Player): The viewer.
- Returns:
Set<LocatorBarCondition>- Active conditions. - Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Checks whether a specific condition filter is currently active for
viewer. - Parameters:
viewer(Player): The viewer.condition(LocatorBarCondition): The condition to query.
- Returns:
boolean-trueif the condition is active. - Throws:
NullPointerExceptionifviewerorconditionis null.IllegalStateExceptionif the API has not been initialized.
- Description: Registers a dynamic custom condition predicate for
viewer. The predicate is passed(viewer, target)and returningtruehides the target. - Parameters:
viewer(Player): The viewer.id(String): Unique identifier for this condition.predicate(BiPredicate<Player, Player>): The evaluator function.
- Throws:
NullPointerExceptionifviewer,id, orpredicateis null.IllegalStateExceptionif the API has not been initialized.
- Description: Removes a custom condition predicate from
viewer. - Parameters:
viewer(Player): The viewer.id(String): Identifier of the condition to remove.
- Throws:
NullPointerExceptionifvieweroridis null.IllegalStateExceptionif the API has not been initialized.
- Description: Clears all custom condition predicates registered for
viewer. - Parameters:
viewer(Player): The viewer.
- Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Checks if
viewerhas a custom condition registered underid. - Parameters:
viewer(Player): The viewer.id(String): The condition identifier.
- Returns:
boolean-trueif registered. - Throws:
NullPointerExceptionifvieweroridis null.IllegalStateExceptionif the API has not been initialized.
- Description: Registers a server-wide custom condition predicate evaluated for all viewers.
- Parameters:
id(String): Unique identifier for this global condition.predicate(BiPredicate<Player, Player>): The evaluator function.
- Throws:
NullPointerExceptionifidorpredicateis null.IllegalStateExceptionif the API has not been initialized.
- Description: Unregisters a server-wide custom condition predicate.
- Parameters:
id(String): Identifier of the condition to remove.
- Throws:
NullPointerExceptionifidis null.IllegalStateExceptionif the API has not been initialized.
- Description: Clears all registered global custom condition predicates.
- Throws:
IllegalStateExceptionif the API has not been initialized.
- Description: Checks if a global custom condition is registered under
id. - Parameters:
id(String): The condition identifier.
- Returns:
boolean-trueif registered. - Throws:
NullPointerExceptionifidis null.IllegalStateExceptionif the API has not been initialized.
- Description: Pins a static coordinate waypoint with custom color and style to a player's locator bar.
- Parameters:
viewer(Player): The viewer player.name(String): Unique identifier for this waypoint (e.g."base","spawn","flag").location(Location): The world coordinates to display.color(Color, nullable): Optional BukkitColorfor the HUD icon. Passnullfor default.style(WaypointStyle, nullable): OptionalWaypointStyle(DEFAULTdot orBOWTIEarrow). Passnullfor default.
- Throws:
NullPointerExceptionifviewer,name, orlocationis null.IllegalStateExceptionif the API has not been initialized.
setWaypoint(Player viewer, String name, Location location, Color color)setWaypoint(Player viewer, String name, Location location, int rgbColor, WaypointStyle style)setWaypoint(Player viewer, String name, Location location, int rgbColor)setWaypoint(Player viewer, String name, Location location, WaypointStyle style)setWaypoint(Player viewer, String name, Location location)setWaypoint(Player viewer, Location location, Color color)setWaypoint(Player viewer, Location location)
- Description: Removes a static coordinate waypoint from a player's locator bar.
- Parameters:
viewer(Player): The viewer player.name(String): The identifier of the waypoint to remove.
- Throws:
NullPointerExceptionifviewerornameis null.IllegalStateExceptionif the API has not been initialized.
- Description: Clears all static coordinate waypoints for a specific player.
- Parameters:
viewer(Player): The viewer player.
- Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Checks whether a static waypoint is registered for a player.
- Parameters:
viewer(Player): The viewer player.name(String): The waypoint identifier.
- Returns:
boolean-trueif present. - Throws:
NullPointerExceptionifviewerornameis null.IllegalStateExceptionif the API has not been initialized.
- Description: Retrieves the location of a static waypoint for a player.
- Parameters:
viewer(Player): The viewer player.name(String): The waypoint identifier.
- Returns:
Location- Clone of the waypoint location, ornullif not found. - Throws:
NullPointerExceptionifviewerornameis null.IllegalStateExceptionif the API has not been initialized.
- Description: Retrieves the Bukkit
Colorassigned to a player's static waypoint. - Returns:
Color- The color, ornullif default/unset.
- Description: Retrieves the
WaypointStyleassigned to a player's static waypoint. - Returns:
WaypointStyle- The style (DEFAULTorBOWTIE).
- Description: Retrieves all static waypoints registered for a player.
- Parameters:
viewer(Player): The viewer player.
- Returns:
Map<String, Location>- Copy of all registered waypoint names and locations. - Throws:
NullPointerExceptionifvieweris null.IllegalStateExceptionif the API has not been initialized.
- Description: Sets a server-wide static waypoint visible to all players in that world.
- Parameters:
name(String): Unique identifier for this global waypoint.location(Location): The world coordinates to display.color(Color, nullable): Optional BukkitColor.style(WaypointStyle, nullable): OptionalWaypointStyle.
- Throws:
NullPointerExceptionifnameorlocationis null.IllegalStateExceptionif the API has not been initialized.
setGlobalWaypoint(String name, Location location, Color color)setGlobalWaypoint(String name, Location location, int rgbColor, WaypointStyle style)setGlobalWaypoint(String name, Location location, int rgbColor)setGlobalWaypoint(String name, Location location, WaypointStyle style)setGlobalWaypoint(String name, Location location)
- Description: Removes a global static waypoint across all players.
- Parameters:
name(String): The identifier of the global waypoint to remove.
- Throws:
NullPointerExceptionifnameis null.IllegalStateExceptionif the API has not been initialized.
- Description: Clears all server-wide static waypoints.
- Throws:
IllegalStateExceptionif the API has not been initialized.
- Description: Checks whether a global static waypoint is registered.
- Parameters:
name(String): The waypoint identifier.
- Returns:
boolean-trueif registered. - Throws:
NullPointerExceptionifnameis null.IllegalStateExceptionif the API has not been initialized.
- Description: Retrieves the location of a global static waypoint.
- Parameters:
name(String): The waypoint identifier.
- Returns:
Location- Clone of the global location, ornullif not found. - Throws:
NullPointerExceptionifnameis null.IllegalStateExceptionif the API has not been initialized.
- Description: Retrieves the Bukkit
Colorof a global static waypoint. - Returns:
Color- The color, ornullif default.
- Description: Retrieves the
WaypointStyleof a global static waypoint. - Returns:
WaypointStyle- The style (DEFAULTorBOWTIE).
- Description: Retrieves all registered global static waypoints.
- Returns:
Map<String, Location>- Copy of all global waypoint names and locations. - Throws:
IllegalStateExceptionif the API has not been initialized.
- Description: Enables or disables automatic server-wide death waypoint tracking. When enabled, dying players automatically receive a static waypoint marker on their locator bar at their death coordinates upon respawning.
- Parameters:
enabled(boolean):trueto enable automatic death waypoints on death.
- Throws:
IllegalStateExceptionif the API has not been initialized.
- Description: Checks whether automatic death waypoints are enabled.
- Returns:
boolean-trueif active.
- Description: Configures the distance in blocks within which a player must arrive for their death waypoint to automatically clear from their HUD. Defaults to
5.0blocks. Pass0or negative to disable auto-clearing upon arrival. - Parameters:
blocks(double): Arrival radius in blocks.
- Description: Gets the current arrival distance radius for auto-clearing death waypoints.
- Returns:
double- Distance in blocks.
- Description: Explicitly sets a death waypoint for
playerwith default red color (#FF2222) and circular marker style. - Parameters:
player(Player): Target player.deathLocation(Location): Death coordinates.
- Description: Explicitly sets a death waypoint for
playerwith a custom RGB color integer andWaypointStyle.
- Description: Clears any active death waypoint from
player's locator bar HUD.
- Description: Retrieves the location of
player's active death waypoint, ornullif none is active. - Returns:
Location- Waypoint coordinates, ornull.
Visual marker icons rendered on the locator bar HUD:
| Constant | Description |
|---|---|
DEFAULT |
Default circular dot marker. |
BOWTIE |
Bowtie/arrow marker icon (standard for player waypoints). |
Enum constants representing contextual state filters:
| Constant | Description |
|---|---|
SNEAKING |
Excludes any target player who is currently sneaking/crouching (player.isSneaking()). |
INVISIBLE |
Excludes any target player who has the Invisibility potion effect, entity invisibility metadata, or zero transmit range attribute. |
PUMPKIN |
Excludes any target player wearing a Carved Pumpkin (Material.CARVED_PUMPKIN) in their helmet slot. |
MOB_HEAD |
Excludes any target player wearing a mob head or skull (Player Head, Zombie Head, Skeleton Skull, Wither Skeleton Skull, Creeper Head, Piglin Head, Dragon Head). |
HEAD_WEARABLE |
Composite condition that matches either a Carved Pumpkin or any Mob Head/Skull. |
SPECTATOR |
Excludes target players in Spectator mode from non-spectator viewers. |
VANISHED |
Excludes target players hidden via Bukkit's visibility system (!viewer.canSee(target)). |
SAME_VEHICLE |
Excludes target players riding the exact same vehicle or mount as the viewer. |
SWIMMING |
Excludes target players who are currently swimming or crawling. |
GLIDING |
Excludes target players who are gliding with Elytra. |
SLEEPING |
Excludes target players who are sleeping in a bed. |
CREATIVE |
Excludes target players who are in Creative mode. |
ADVENTURE |
Excludes target players who are in Adventure mode. |
SURVIVAL |
Excludes target players who are in Survival mode. |
NON_SURVIVAL |
Composite condition that excludes target players in any non-survival mode (Creative, Adventure, Spectator). |
ALL |
Wildcard condition that excludes any target player matching any of the above conditions. |
All events inherit from org.bukkit.event.Event and support both Paper and Folia threaded region listeners.
- Package:
dev.mukulx.locatorbarapi.event - Interfaces:
Cancellable - Description: Fired before a candidate target player is tracked/rendered on a viewer's locator bar HUD.
- Methods:
getViewer():Player- The player observing the locator bar.getTarget():Player- The player about to appear.isCancelled():booleansetCancelled(boolean cancel): Cancelling prevents the target from appearing on the viewer's locator bar.
- Package:
dev.mukulx.locatorbarapi.event - Description: Fired when a target player is removed from a viewer's locator bar HUD.
- Methods:
getViewer():Player- The player observing the locator bar.getTarget():Player(nullable) - The player removed, ornullif disconnected.getTargetId():UUID(nullable) - The unique identifier of the target player (always available even if the player has disconnected).
- Package:
dev.mukulx.locatorbarapi.event - Interfaces:
Cancellable - Description: Fired when a player's locator bar operating mode changes (
HIDDEN,MANAGED,VANILLA). - Methods:
getPlayer():Player- The player whose mode is changing.getOldMode():String- Previous mode name.getNewMode():String- New mode name.isCancelled():booleansetCancelled(boolean cancel): Cancelling prevents the mode transition.
- Package:
dev.mukulx.locatorbarapi.event - Interfaces:
Cancellable - Description: Fired when a world's locator bar gamerule state is toggled via
LocatorBarAPI.setWorldEnabled(). - Methods:
getWorld():World- The affected world.isEnabled():boolean- Target state (truefor enabled,falsefor disabled).isCancelled():booleansetCancelled(boolean cancel): Cancelling prevents the gamerule change.