Bar Command Parameter - ryandw11/UltraBar GitHub Wiki

UltraBar 2.0 introduces a brand new /bar command. This new bar command has what are called bar parameters.
They look like this: player:@a. There are a bunch of parameters so look around here and see what they all do.

Parameters are separated into keys and values. They look like this: key:value
So for example, player:@a
player is the key
and @a is the value. The semicolon (:) must be in between the key and value always. There can not be a space between the semicolon for both the key and value!

Required Parameters

These parameters are required in order for the command to run.

player:
(Except when persist:true) time: 
msg:

Parameters

Message Parameter

Parameter Key: msg, message
Parameter Value: any string. (For example: "Hello World")
Example Use: /bar msg:"&cI am the message"

This parameter is required on all bars!
The message parameter is used to add a message to the bar. Color codes can be used.

Player Parameter

Parameter Key: p, player, players
Parameter Value: playername, a collection of players: playername1,playername2, or all, @a, *
Example Use: /bar player:Ryandw11
Example Use 2: /bar player:Ryandw11,KingTux
Example Use 3: /bar player:@a

This parameter is required on all bars!
Who to send the bar to. It can be a single player, a list of players, or everyone on the server.
The following permission is needed to send a bossbar to everyone: ultrabar.bar.player.all
The following permission is needed to send a bossbar to a list of players: ultrabar.bar.player.list

Time Parameter

Parameter Key: time, t
Parameter Value: any integer greater than 0
Example Use: /bar time:3

This parameter is required on all bars! (Except when the parameter perm:true is on the bar)
The time parameter is used to say how long the bar will stay on screen (time in seconds.)

Color Parameter

Parameter Key: color, c
Parameter Value: A valid color name. (see this page)
Example Use: /bar color:green

What color the bar will be.

Style Parameter

Parameter Key: style, s
Parameter Value: A valid style. (see this page)
Example Use: /bar style:10

What style the bar will be.

Progress Parameter

Parameter Key: progress, prog
Parameter Value: A decimal between 0 and 1
Example Use: /bar prog:0.5

What the progress of the bar will be. (0.5 is half way done)

World Parameter

Parameter Key: world, w
Parameter Value: A world name
Example Use: /bar w:world

Limit the world that players can see the bar in.

Persistent Parameter

Parameter Key: persist, persistent
Parameter Value: true
Example Use: /bar persist:true
Permission: ultrabar.bar.persistent

This will effectively make the bar last forever (or until server restart).

Permission Parameter

Parameter Key: perm, permission
Parameter Value: [any permission]
Example Use: /bar perm:"ultrabar.custom.permission"
Permission: ultrabar.bar.permission

This will only display the bar to those with said permissions. This does not override the player parameter, so you could use this with player:* or player:notch,jeb_,ryandw11,kingtux. If a player list is given, then only those in the list with the desired permission will be shown the bar.

Clear Parameter

Parameter Key: clear
Parameter Value: death, world
Example Use: /bar clear:death
Permission: ultrabar.bar.clear

If a player dies or changes world they are removed from the boss bar. (Since version 2.1)

Id Parameter

Parameter Key: id
Parameter Value: Any numerical value
Example Use: /bar id:1
Permission: ultrabar.bar.id

Assigns an id to a bar. This can be used with the cancel command to cancel the bar(s). Ex:
/ultrabar cancel 1

Count Style

Parameter Key: countStyle, cs
Parameter Value: Up or Down
Example Use: /bar countStyle:up
Permission: ultrabar.bar.countstyle

Determines if a timed boss bar will count up or down.

Command Parameter

Parameter Key: cmd, command
Parameter Value: Any command.
Example Use: /bar cmd:"say Hello there!"
Permission: ultrabar.bar.command

When the time runs out on a bossbar the command is ran.
Note: The command runs from the console. Make sure that you only give people you want to permission to use this parameter!

For Developers

You can add in custom parameters by implementing the BarParameter class.
Click for more information.