api/Send your message through ServerCaster (1.8+)
Attention: This is for the 1.8 update and does not work with earlier versions
You can use the ServerCaster plugin to cast messages with the same markup as you do inside the config.yml.
To use this you only need to call one of these functions from ServerCaster:
- public static void castMessage(JavaPlugin plugin, String message)
- public static void castMessage(JavaPlugin plugin, String message, String prefix)
- public static void castMessage(JavaPlugin plugin, String message, Player[] players)
- public static void castMessage(JavaPlugin plugin, String message, String prefix, Player[] players)
JavaPlugin plugin:
This is your main class (the one that extends from JavaPlugin). This is used so that the program can call the real instance of ServerCaster.
String message:
This is the string you want to convert and send with ServerCaster.
String prefix [optional]:
The string you want to put before each line.
Defaults to the one specified inside config.yml.
Player[] players [optional]:
A list of the players you want to send a message to.
Defaults to all online players.
Comments