-
Notifications
You must be signed in to change notification settings - Fork 5
Create Custom Bar Parameters
Ryandw11 edited this page Nov 28, 2019
·
2 revisions
To create custom bar parameters you need to implement BarParameters and add in the unimplements methods.
import me.ryandw11.ultrabar.api.BossBarBuilder;
import me.ryandw11.ultrabar.api.parameters.BarParameter;
public class ExampleParameter implements BarParameter{
@Override
public String getPluginName() {
return "UltraBar";
}
@Override
public List<String> aliases() {
return Arrays.asList("par", "parameter");
}
@Override
public String tab() {
return "par";
}
@Override
public void barCreation(String value, BossBarBuilder barBuilder, CommandSender creator) {
//Do Stuff
}
}
Get plugin name needs to return your plugin name. (It is used when /ultrabar hooks
command is called)
Needs to return a list of keys for your parameter
Needs to return a string that will be shown in tab complete
Called when your parameter is used.
UltraBarAPI uapi = new UltraBarAPI();
uapi.registerParameter(new ExampleParameter());