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/ScoreboardIdentity.md.

Class: ScoreboardIdentity

scoreboard

Beta

表示记分板上的分数持有者。

Contains an identity of the scoreboard item.

Properties

displayName

readonly displayName: string

Beta

Remarks

此分数持有者在玩家视角显示的名称。

Returns the player-visible name of this identity.


id

readonly id: number

Beta

Remarks

此分数持有者的 ID。

Identifier of the scoreboard identity.


isValid

readonly isValid: boolean

Beta

Remarks

如果 ScoreboardIdentity 引用仍然有效,则返回 true。

Returns true if the ScoreboardIdentity reference is still valid.


type

readonly type: ScoreboardIdentityType

Beta

Remarks

此分数持有者的类型。

Type of the scoreboard identity.

Methods

getEntity()

getEntity(): Entity | undefined

Beta

Returns

Entity | undefined

对应的实体对象。虚拟玩家类型的分数持有者会返回 undefined

Remarks

返回此分数持有者对应的实体对象(仅当此分数持有者是一个实体或者玩家时)。

If the scoreboard identity is an entity or player, returns the entity that this scoreboard item corresponds to.

Throws

若实体不存在时,抛出。

同领域相关