Class: PlayerWaypoint
playerBeta
跟踪玩家位置的导航点。扩展 EntityWaypoint,增加了特定于玩家的可见性规则,如隐藏状态和旁观者模式。
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
Beta
Parameters
player
textureSelector
playerRules
color?
Returns
PlayerWaypoint
Throws
This function can throw errors.
InvalidWaypointTextureSelectorError
Overrides
Properties
color?
optionalcolor?: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
entity
readonlyentity:Entity
Beta
Remarks
The entity being tracked by this waypoint.
Throws
This property can throw when used.
InvalidWaypointTextureSelectorError
Inherited from
entityRules
readonlyentityRules: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.
InvalidWaypointTextureSelectorError
Inherited from
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
isValid
readonlyisValid:boolean
Beta
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
Beta
Remarks
控制导航点何时基于玩家状态显示的 PlayerVisibilityRules(例如隐藏、旁观者模式、旁观者查看其他旁观者)。
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
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
EntityWaypoint.textureSelector
Methods
getDimensionLocation()
getDimensionLocation():
DimensionLocation
World Mutation Beta
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.
获取路径点的当前 DimensionLocation。对于实体路径点,返回实体的当前位置。对于位置路径点,返回存储的位置。
Throws
This function can throw errors.
InvalidWaypointTextureSelectorError
Inherited from
EntityWaypoint.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.
从所有已添加的定位栏中移除该路径点。这会影响所有在其定位栏中拥有此路径点的玩家。
