MessagesFile
Since 1.0.0
Last updated
Since 1.0.0
Last updated
The most notorious feature from MessagesFile is that they can be used to send any type of messages directly from the file, they include all the methods from PluginFile and...
Method | Returns | Description |
---|---|---|
The default Replacer is essentially a Replacer that gets stored on the MessagesFile and is applied on every message, a common implementation of this default replacer would be:
Getters work they way you might expect but they support replacements if specified, if you only specify a path, the String on that path will be returned as usual, if you also specify a Replacer (As a Replacer object or the Objects directly), that replacements will be applied. This affects to both strings and string lists and color patterns are automatically applied. Assuming the value under the path "Test.Path" is "This is a %test%
Sending messages can be as simple as sending a string and as complex as sending a different message depending if the receiver is a player or the console, all of this methods come with color, target and event pattern support, so every administrator can choose how every message will be displayed just by modifying a yml file, as simple as that. Here is how to use them
setDefaultReplacer(Replacer)
void
See default Replacer
getDefaultReplacer()
See default Replacer
getString(String)
String
See getters
getString(String, Replacer)
String
See getters
getString(String, Object...)
String
See getters
getStringList(String)
List<String>
See getters
getStringList(String, Replacer)
List<String>
See getters
getStringList(String, Object...)
List<String>
See getters
send(CommandSender, String)
true
See senders
send(CommandSender, String, Replacer)
true
See senders
send(CommandSender, String, Object...)
true
See senders