Skip to content

@minecraft/server


@minecraft/server / EntityWaypoint

Class: EntityWaypoint ​

Defined in: @minecraft/server/index.d.ts:12785

Waypoint that tracks an entity's position. The waypoint automatically updates as the entity moves and becomes invalid when the entity is removed.

Extends ​

Extended by ​

Constructors ​

Constructor ​

new EntityWaypoint(entity, textureSelector, entityRules, color?): EntityWaypoint

Defined in: @minecraft/server/index.d.ts:12815

Parameters ​

entity ​

Entity

textureSelector ​

WaypointTextureSelector

entityRules ​

EntityVisibilityRules

color? ​

RGB

Returns ​

EntityWaypoint

Throws ​

This function can throw errors.

InvalidWaypointTextureSelectorError

Overrides ​

Waypoint.constructor

Properties ​

color? ​

optional color?: 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 ​

Waypoint.color


entity ​

readonly entity: Entity

Defined in: @minecraft/server/index.d.ts:12796

Remarks ​

The entity being tracked by this waypoint.

Throws ​

This property can throw when used.

InvalidWaypointError

InvalidWaypointTextureSelectorError


entityRules ​

readonly entityRules: 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.

InvalidWaypointError

InvalidWaypointTextureSelectorError


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 ​

Waypoint.isEnabled


isValid ​

readonly isValid: 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 ​

Waypoint.isValid


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 ​

Waypoint.textureSelector

Methods ​

getDimensionLocation() ​

getDimensionLocation(): DimensionLocation

Defined in: @minecraft/server/index.d.ts:21074

Returns ​

DimensionLocation

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.

InvalidWaypointError

InvalidWaypointTextureSelectorError

Inherited from ​

Waypoint.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.

Inherited from ​

Waypoint.remove