BedrioxDOCUMENTATION
API CLASS

Sidebar

A plugin-owned sidebar with shared content and lightweight per-player views.

Bedriox\Api\Scoreboard\Sidebar
classBedriox\Api\Scoreboard

Public methods

__construct(string $id, Closure $state, Closure $mutate, Closure $getViewFor, Closure $showTo, Closure $hideFrom, Closure $isShowingTo, Closure $showToAll, Closure $hideFromAll, Closure $remove)

Typed public method.

getId(): string

Typed public method.

getTitle(): string

Typed public method.

setTitle(string $title): void

Typed public method.

getLines(): array

Typed public method.

getLine(string $key): ?string

Typed public method.

hasLine(string $key): bool

Typed public method.

setLine(string $key, string $text, ?int $position = null): void

Positions are one-based. Omitting one appends a new line and preserves an existing line's position.

prependLine(string $key, string $text): void

Typed public method.

insertBefore(string $existingKey, string $key, string $text): void

Typed public method.

insertAfter(string $existingKey, string $key, string $text): void

Typed public method.

moveLine(string $key, int $position): void

Typed public method.

removeLine(string $key): bool

Typed public method.

clearLines(): void

Typed public method.

replaceLines(array $lines): void

Typed public method.

getViewFor(Bedriox\Api\Player\Player $player): Bedriox\Api\Scoreboard\SidebarView

Returns the same logical view whenever called for the same sidebar and player UUID.

showTo(Bedriox\Api\Player\Player $player): void

Typed public method.

hideFrom(Bedriox\Api\Player\Player $player): void

Typed public method.

isShowingTo(Bedriox\Api\Player\Player $player): bool

Typed public method.

getViewers(): array

Typed public method.

showToAll(): void

Typed public method.

hideFromAll(): void

Typed public method.

isRemoved(): bool

Typed public method.

remove(): void

Typed public method.

static validateText(string $text, string $field): void

Typed public method.

static validateLineKey(string $key): void

Typed public method.

Constants

MAXIMUM_LINESMAXIMUM_TEXT_BYTESMAXIMUM_LINE_KEY_BYTES

View exact source ↗