Skip to content
BasaltSoftware
Bedrock 1.26.60

Site colour

Discord
Esc

    ↑↓ moveEnter openEsc close

    Keyboard shortcuts
    Ctrl K
    Search the whole site, from any page
    /
    Jump to the sidebar search, or search the whole site where there isn't one
    Enter
    Open the top search result
    Esc
    Clear the search, or close this panel
    ?
    Show these shortcuts
    Scoreboard

    ScoreboardIdentity

    Class in @minecraft/server

    Someone with a score: a player, an entity, or a fake player who’s only a name.

    import { ScoreboardIdentity } from '@minecraft/server';
    import { world, type ScoreboardIdentity } from '@minecraft/server';
    for (const player of world.getAllPlayers()) {
    const scoreboardIdentity: ScoreboardIdentity | undefined = player.scoreboardIdentity;
    console.log(player.name, scoreboardIdentity?.id);
    }
    import { world } from '@minecraft/server';
    for (const player of world.getAllPlayers()) {
    const scoreboardIdentity = player.scoreboardIdentity;
    console.log(player.name, scoreboardIdentity?.id);
    }

    read-only

    readonly id: number;

    The scoreboard’s id for them.

    read-only

    readonly type: ScoreboardIdentityType;

    read-only

    readonly displayName: string;

    A player’s name, Player Offline for one not seen this session, or a fake player’s name.

    read-only

    readonly isValid: boolean;

    False once they hold no score.

    getEntity(): Entity | undefined;

    The player, while online. undefined for entities and fake players in Basalt.

    Returns
    Entity | undefined
    Types

    Entity.scoreboardIdentity, ScoreboardScoreInfo.participant, ScoreboardObjective.getParticipants, Scoreboard.getParticipants