Bossbar

A bossbar is a bar that can track a boss mob's health or the total health of raid mobs.

Manual creation
A bossbar can be shown using the command.

Boss mobs
A bossbar appears in the top center of the screen when near a wither or ender dragon.

For the ender dragon's bossbar to appear, the player must be within a Euclidean distance of 192 blocks from the coordinates (0.0, 192, 0.0) in the End dimension.

For the wither's bossbar to appear, the player must be loading the chunk the wither is in and be within 24 chunks and 3.5 blocks of a chunk the wither is in.

Raids
When a player is within a 93 radius of the center of a raid, a raid bossbar appears, showing the total health of all raid mobs present during the current wave.

Color
The bossbar has colors depending on which boss mob or event is active.

The ender dragon has a color of pink. The wither has a dark purple or pink bossbar. The raid bossbar has a color of red.

ID system
A bossbar has an ID, which can be used to do certain actions with one bossbar. An ID is not shown on the creation of the bossbar, so you can't see it.

Removing
A bossbar can be disabled by using.