@minecraft/server / PlayerWaypoint
Class: PlayerWaypoint ​
Defined in: @minecraft/server/index.d.ts:18319
Waypoint that tracks a player's position. Extends EntityWaypoint with additional player-specific visibility rules such as hidden state and spectator mode.
Extends ​
Constructors ​
Constructor ​
new PlayerWaypoint(
player,textureSelector,playerRules,color?):PlayerWaypoint
Defined in: @minecraft/server/index.d.ts:18338
Parameters ​
player ​
textureSelector ​
playerRules ​
color? ​
Returns ​
PlayerWaypoint
Throws ​
This function can throw errors.
InvalidWaypointTextureSelectorError
Overrides ​
Properties ​
color? ​
optionalcolor?:RGB
Defined in: @minecraft/server/index.d.ts:21031
Remarks ​
Optional RGB color tint applied to the waypoint icon. If not specified, the waypoint uses its default color.
This property can't be edited in restricted-execution mode.
Inherited from ​
entity ​
readonlyentity:Entity
Defined in: @minecraft/server/index.d.ts:12796
Remarks ​
The entity being tracked by this waypoint.
Throws ​
This property can throw when used.
InvalidWaypointTextureSelectorError
Inherited from ​
entityRules ​
readonlyentityRules:EntityVisibilityRules
Defined in: @minecraft/server/index.d.ts:12809
Remarks ​
The visibility rules that control when the waypoint is shown based on the entity's state (e.g., sneaking, invisible, dead).
Throws ​
This property can throw when used.
InvalidWaypointTextureSelectorError
Inherited from ​
isEnabled ​
isEnabled:
boolean
Defined in: @minecraft/server/index.d.ts:21041
Remarks ​
Controls whether the waypoint is currently displayed on the player's screen. When disabled, the waypoint is hidden but remains valid.
This property can't be edited in restricted-execution mode.
Inherited from ​
isValid ​
readonlyisValid:boolean
Defined in: @minecraft/server/index.d.ts:21048
Remarks ​
Returns whether the waypoint is currently valid. A waypoint becomes invalid when its tracked entity is no longer valid.
Inherited from ​
playerRules ​
readonlyplayerRules:PlayerVisibilityRules
Defined in: @minecraft/server/index.d.ts:18332
Remarks ​
The PlayerVisibilityRules that control when the waypoint is shown based on the player's state (e.g., hidden, spectator mode, spectator viewing another spectator).
Throws ​
This property can throw when used.
InvalidWaypointTextureSelectorError
textureSelector ​
textureSelector:
WaypointTextureSelector
Defined in: @minecraft/server/index.d.ts:21058
Remarks ​
The WaypointTextureSelector that determines which icon texture is displayed for the waypoint based on distance or other criteria.
This property can't be edited in restricted-execution mode.
Inherited from ​
EntityWaypoint.textureSelector
Methods ​
getDimensionLocation() ​
getDimensionLocation():
DimensionLocation
Defined in: @minecraft/server/index.d.ts:21074
Returns ​
Remarks ​
Gets the current DimensionLocation of the waypoint. For entity waypoints, this returns the entity's current position. For location waypoints, this returns the stored location.
This function can't be called in restricted-execution mode.
Throws ​
This function can throw errors.
InvalidWaypointTextureSelectorError
Inherited from ​
EntityWaypoint.getDimensionLocation
remove() ​
remove():
void
Defined in: @minecraft/server/index.d.ts:21084
Returns ​
void
Remarks ​
Removes the waypoint from all locator bars it has been added to. This affects all players who have this waypoint in their locator bar.
This function can't be called in restricted-execution mode.