Create Boss Bar (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.16

Syntax

[a] [new] [%-color%] boss[ ]bar [(with title|titled) %-textcomponent%]

Description

Creates a new boss bar. Boss bars can be pink/blue/red/green/yellow/purple/white, and will pick the closest valid color to the one you provide. Boss bars can have viewers removed or added to them. Making the boss bar 'keyed' will add it to the persistent storage of the server and will be editable by commands and restored after restart.

Examples

on join:
	set {_bar} to a boss bar:
		set color of event-bossbar to white
		set title of event-bossbar to "<green>Welcome %player%!"
		set progress of event-bossbar to 50%
		set style of event-bossbar to 6 notches
		make event-bossbar darken the sky
	add player to viewers of {_bar}
	wait 5 seconds
	remove player from viewers of {_bar}
command /createkeyedbar:
    set {_bar} to a red keyed bossbar with title "<red>My persistent red bar":
        set progress of event-bossbar to 14%
        set style of event-bossbar to 20 notches
    loop all operators:
        add loop-value to viewers of {_bar}

View source