← All articles

Bossbars for Minecraft events: when a bar beats chat, and how to build a countdown

Chat scrolls away, a title fades after a few seconds, and an action bar line is gone before half the players have read it. A bossbar stays at the top of the screen for as long as the event lasts, and everyone sees the same fill. That makes it the place for shared state: how much time is left, how far a ritual has got, which phase a raid is in.

Checked for versions: Java Edition 1.15–26.3 (/schedule … replace and /schedule clear need 1.15; everything else works from 1.13). Data pack folder names below are for 1.21 and newer.

Pick the channel by how long the information matters

ChannelHow long it staysGood forPoor for
Chat (tellraw)Until it scrolls away; stays in chat historyRules, instructions, exact wordingAnything players must watch while moving
Title and subtitleAbout 5 seconds with the default timing (0.5 s in, 3.5 s on screen, 1 s out)The start or end of an event, one heavy momentInformation needed later
Action barA few seconds above the hotbarPersonal feedback: "Quest updated", "Not enough tokens"State the whole server shares
BossbarUntil you hide or remove itTimers, progress, phases, a boss's healthMessages and dialogue

A well-run event usually uses several at once: a title when it starts, one chat line that says what the bar measures, the bar itself for the duration, and a title or chat line at the end. For the message side, see readable server announcements.

Four bossbar patterns that work on RP servers

Countdown

"Evacuation window", "The ritual completes in…". The bar starts full and drains. Use the progress style and a yellow or red color. The full recipe is below.

Charge

The bar fills as players act: offerings brought, generators repaired, votes cast. max is the goal, and the value comes from a scoreboard your event already counts:

execute store result bossbar cube:ritual_charge value run scoreboard players get #offerings ritual

Phases

A raid in four stages: max 4, and value is the current stage. Choose a notched style that divides evenly by the number of stages (notched_12 for 4 or 6 stages, notched_10 for 5), so phase boundaries land on notches.

Boss health

For a custom boss summoned with a tag, copy its health into the bar every tick or every second. Set max to the boss's maximum health (300 here); the stored value is the health rounded down:

bossbar set cube:event_boss max 300
execute store result bossbar cube:event_boss value run data get entity @e[tag=event_boss,limit=1] Health

The selector must find exactly one entity. If the boss is dead or unloaded the second line fails and the bar keeps its last value, so remove the bar when the fight ends. Different groups can see different bars: give each one its own selector, such as players @a[team=defenders].

Rules that keep event UI readable

A working countdown

A bossbar does not count by itself. You keep the remaining time in a scoreboard, lower it on a schedule and copy it into the bar. The one thing to get right is the unit: a repeating command block runs every game tick, 20 times per second, so a loop that subtracts 1 per run counts ticks, not seconds. A "60 second" timer set to 60 would be over in three seconds.

With command blocks (counting ticks)

Setup, run once from chat or an impulse block. 60 seconds are 1200 ticks:

/scoreboard objectives add event_timer dummy
/scoreboard players set #timer event_timer 1200
/bossbar add cube:evacuation {"text":"Evacuation","color":"yellow"}
/bossbar set cube:evacuation color yellow
/bossbar set cube:evacuation max 1200
/bossbar set cube:evacuation value 1200
/bossbar set cube:evacuation players @a

The loop is one repeating command block followed by four chain blocks, all set to Always Active, in this order (command blocks accept the commands with or without a leading slash):

execute if score #timer event_timer matches 1.. run scoreboard players remove #timer event_timer 1
execute if score #timer event_timer matches 0.. store result bossbar cube:evacuation value run scoreboard players get #timer event_timer
execute if score #timer event_timer matches 0 run say The evacuation window is closed.
execute if score #timer event_timer matches 0 run bossbar remove cube:evacuation
execute if score #timer event_timer matches 0 run scoreboard players set #timer event_timer -1

The first block only subtracts while time is left. The second copies the time into the bar. At zero the last three blocks run your event command, remove the bar and park the timer at -1, so nothing repeats on the following ticks. Running the setup again restarts the countdown.

With a data pack (counting seconds)

In a data pack you can skip per-tick work entirely: a function reschedules itself once per second. Three files in the namespace cube (before 1.21 the folder is functions, not function):

data/cube/function/evacuation/start.mcfunction

scoreboard objectives add event_timer dummy
scoreboard players set #timer event_timer 60
bossbar add cube:evacuation {"text":"Evacuation","color":"yellow"}
bossbar set cube:evacuation color yellow
bossbar set cube:evacuation max 60
bossbar set cube:evacuation value 60
bossbar set cube:evacuation players @a
schedule function cube:evacuation/second 1s replace

data/cube/function/evacuation/second.mcfunction

scoreboard players remove #timer event_timer 1
execute store result bossbar cube:evacuation value run scoreboard players get #timer event_timer
bossbar set cube:evacuation players @a
execute if score #timer event_timer matches 1.. run schedule function cube:evacuation/second 1s replace
execute if score #timer event_timer matches ..0 run function cube:evacuation/finish

data/cube/function/evacuation/finish.mcfunction

bossbar remove cube:evacuation
say The evacuation window is closed.

Start it with /function cube:evacuation/start. The players line in second adds anyone who logged in during the countdown. Nothing runs between the seconds, and /schedule clear cube:evacuation/second stops the countdown early (remove the bar afterwards).

Common mistakes

FAQ

Can every player have a personal timer?

Not with one bar: its value is the same for everyone who sees it. For personal timers use the action bar or a per-player score.

Ticks or seconds?

Seconds with /schedule when a one-second step is precise enough. Ticks with a repeating block or a tick function when the bar should drain perfectly smoothly.

Can the title show the remaining seconds?

Not on its own. The name is fixed when bossbar set … name runs, so you would have to set it again every second. Most events read fine with a short title and the bar itself.

Does it work on Bedrock?

No. /bossbar and /schedule are Java Edition commands.