New value for the action bar text.
Set the action bar text - a piece of text that displays beneath the title and above the hot-bar.
This function can't be called in read-only mode.
Optional
options: TitleDisplayOptionsWill cause a title to show up on the player's on screen display. Will clear the title if set to empty string. You can optionally specify an additional subtitle as well as fade in, stay and fade out times.
This function can't be called in read-only mode.
let players = mc.world.getPlayers();
players[0].onScreenDisplay.setTitle("Get ready!", {
stayDuration: 220,
fadeInDuration: 2,
fadeOutDuration: 4,
subtitle: "10",
});
let countdown = 10;
let intervalId = mc.system.runInterval(() => {
countdown--;
players[0].onScreenDisplay.updateSubtitle(countdown.toString());
if (countdown == 0) {
mc.system.clearRun(intervalId);
}
}, 20);
Updates the subtitle if the subtitle was previously displayed via the setTitle method.
This function can't be called in read-only mode.
Contains information about user interface elements that are showing up on the screen.