Skip to content
This repository was archived by the owner on Jan 9, 2025. It is now read-only.
Kyle Charters edited this page Sep 24, 2015 · 6 revisions

PrefixedAPI

To add a parameter to prefixed, simply call

PrefixedAPI.addParameter(PrefixedParameter parameter);

When creating a parameter, you must define the parameter name inside the constructor, like so:

new PrefixedParameter("Name goes here"){}

Finally, you must create the use(Player player, String message) method, which will be called when a player chats, as long as it is defined in the Prefixed configuation.

##Example

This code adds the parameter "-CAPNAME", which returns the player's name in uppercase.

PrefixedAPI.addParameter(new PrefixedParameter("CAPNAME"){
	@Override
	public String use(Player player, String message){
		return player.getName().toUpperCase();
	}
});

Then, when the parameter "-CAPNAME" is defined in the prefixed config format node, it will place the players name in caps where the "-CAPNAME" parameter is.

PrefixedAPI Javadoc: http://kylecharters.github.io/prefixed/javadoc/

Clone this wiki locally