ScoreboardIdentity Class

Contains an identity of the scoreboard item.

Properties

displayName

read-only displayName: string;

Returns the player-visible name of this identity.

Type: string

id

read-only id: number;

Identifier of the scoreboard identity.

Type: number

type

read-only type: ScoreboardIdentityType;

Type of the scoreboard identity.

Type: ScoreboardIdentityType

Methods

getEntity

getEntity(): Entity | undefined

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

Returns Entity | undefined

Warning

This function can throw errors.

isValid

isValid(): boolean

Returns true if the ScoreboardIdentity reference is still valid.

Returns boolean