Scoreboard management

Scoreboard

A Scoreboard manages objectives and teams. Each player can see one scoreboard at a time — assign a custom scoreboard to show custom sidebar content, name tags, or tab list formatting.


Class Methods

create

board = Scoreboard.create()

Create a new empty scoreboard. This is synchronous.

board = Scoreboard.create()
await player.set_scoreboard(board)

Attributes

objectives

All objectives registered on this scoreboard.

teams

All teams registered on this scoreboard.


Methods

register_objective

objective = board.register_objective(name, criteria, display_name="")

Register a new objective. This is synchronous.

obj = board.register_objective("kills", "dummy", "§c§lKill Count")

get_objective

objective = board.get_objective(name)

Get an existing objective by name.

register_team

team = board.register_team(name)

Register a new team. This is synchronous.

red_team = board.register_team("red")
await red_team.set_prefix("§c[RED] ")
await red_team.set_color("RED")

get_team

team = board.get_team(name)

Get an existing team by name.

clear_slot

await board.clear_slot(slot)

Clear the display in a specific slot.


Example: Kill counter sidebar

from bridge import *

board = Scoreboard.create()
obj = board.register_objective("kills", "dummy", "§6§lKill Count")
await obj.set_display_slot("SIDEBAR")

@event
async def player_join(e: Event):
    await e.player.set_scoreboard(board)

@event
async def entity_death(e: Event):
    killer = e.damager
    if killer and hasattr(killer, 'name'):
        score = obj.get_score(killer.name)
        # Score tracking happens automatically via the scoreboard API

See also: Sidebar for a simpler high-level sidebar helper.