Class in @minecraft/server
What’s on a player’s screen.
import { ScreenDisplay } from '@minecraft/server';Example
Section titled “Example”import { world, type ScreenDisplay } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const screenDisplay: ScreenDisplay = player.onScreenDisplay; console.log(player.name, screenDisplay.isValid);}import { world } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const screenDisplay = player.onScreenDisplay; console.log(player.name, screenDisplay.isValid);}Properties
Section titled “Properties”isValid
Section titled “isValid”read-only
readonly isValid: boolean;Methods
Section titled “Methods”setTitle
Section titled “setTitle”setTitle(title: string | RawMessage | (string | RawMessage)[], options?: TitleDisplayOptions): void;Parameters
titlestring | RawMessage | (string | RawMessage)[]optionsoptionalTitleDisplayOptions
updateSubtitle
Section titled “updateSubtitle”updateSubtitle(subtitle: string | RawMessage | (string | RawMessage)[]): void;Parameters
subtitlestring | RawMessage | (string | RawMessage)[]
Types
setActionBar
Section titled “setActionBar”setActionBar(text: string | RawMessage | (string | RawMessage)[]): void;Parameters
textstring | RawMessage | (string | RawMessage)[]
Types
clearTitle
Section titled “clearTitle”clearTitle(): void;Takes the title off the screen.
resetTitle
Section titled “resetTitle”resetTitle(): void;Puts the title’s times and subtitle back to the client’s own.
setHudVisibility
Section titled “setHudVisibility”setHudVisibility(visible: HudVisibility, hudElements?: HudElement[]): void;Hides HUD elements, or shows them as usual again; every element if none are named.
Parameters
visibleHudVisibilityhudElementsoptionalHudElement[]
hideAllExcept
Section titled “hideAllExcept”hideAllExcept(hudElements?: HudElement[]): void;Hides every HUD element but these.
Parameters
hudElementsoptionalHudElement[]
Types
resetHudElementsVisibility
Section titled “resetHudElementsVisibility”resetHudElementsVisibility(): void;Shows every HUD element as usual.
isForcedHidden
Section titled “isForcedHidden”isForcedHidden(hudElement: HudElement): boolean;Whether a plugin hid this element.
Parameters
hudElementHudElement
Returns
booleanTypes