For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /server/classes/EntityWaypoint.md.

Class: EntityWaypoint

entity

Beta

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

Beta

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

World Mutation Beta

Remarks

Optional RGB color tint applied to the waypoint icon. If not specified, the waypoint uses its default color.

应用于路径点图标的可选 RGB 颜色色调。如果未指定,路径点将使用其默认颜色。

Inherited from

Waypoint.color


entity

readonly entity: Entity

Beta

Remarks

The entity being tracked by this waypoint.

Throws

This property can throw when used.

InvalidWaypointError

InvalidWaypointTextureSelectorError


entityRules

readonly entityRules: EntityVisibilityRules

Beta

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

World Mutation Beta

Remarks

Controls whether the waypoint is currently displayed on the player's screen. When disabled, the waypoint is hidden but remains valid.

控制路径点当前是否显示在玩家的屏幕上。禁用时,路径点会被隐藏但仍保持有效。

Inherited from

Waypoint.isEnabled


isValid

readonly isValid: boolean

Beta

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

World Mutation Beta

Remarks

The WaypointTextureSelector that determines which icon texture is displayed for the waypoint based on distance or other criteria.

根据距离或其他条件确定路径点显示哪种图标纹理的 WaypointTextureSelector

Inherited from

Waypoint.textureSelector

Methods

getDimensionLocation()

getDimensionLocation(): DimensionLocation

World Mutation Beta

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.

获取路径点的当前 DimensionLocation。对于实体路径点,返回实体的当前位置。对于位置路径点,返回存储的位置。

Throws

This function can throw errors.

InvalidWaypointError

InvalidWaypointTextureSelectorError

Inherited from

Waypoint.getDimensionLocation


remove()

remove(): void

World Mutation Beta

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.

从所有已添加的定位栏中移除该路径点。这会影响所有在其定位栏中拥有此路径点的玩家。

Inherited from

Waypoint.remove

同领域相关