Class: ScoreboardIdentity
scoreboardBeta
表示记分板上的分数持有者。
Contains an identity of the scoreboard item.
Properties
displayName
readonlydisplayName:string
Beta
Remarks
此分数持有者在玩家视角显示的名称。
Returns the player-visible name of this identity.
id
readonlyid:number
Beta
Remarks
此分数持有者的 ID。
Identifier of the scoreboard identity.
isValid
readonlyisValid:boolean
Beta
Remarks
如果 ScoreboardIdentity 引用仍然有效,则返回 true。
Returns true if the ScoreboardIdentity reference is still valid.
type
readonlytype: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
若实体不存在时,抛出。
