Skip to content

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
	}

}

getPluginName()

Get plugin name needs to return your plugin name. (It is used when /ultrabar hooks command is called)

aliases()

Needs to return a list of keys for your parameter

tab()

Needs to return a string that will be shown in tab complete

barCreation()

Called when your parameter is used.

Registering the Parameter

UltraBarAPI uapi = new UltraBarAPI();
uapi.registerParameter(new ExampleParameter());
Clone this wiki locally