Messaging
Use Messenger and the built-in message services to send localized output.
Messaging is centered on the Messenger interface. The framework ships with AdventureMessenger and LegacyMessenger, so you can choose whether you want Adventure components or legacy strings.
package com.example.myplugin.feature;
import com.zetaplugins.zetacore.messaging.Messenger;
import com.zetaplugins.zetacore.messaging.Replaceable;
import org.bukkit.command.CommandSender;
public class MessageExample {
private final Messenger messenger;
public MessageExample(Messenger messenger) {
this.messenger = messenger;
}
public void greet(CommandSender sender, String name) {
messenger.send(
sender,
true,
"messages.greeting",
"Hello, %name%!",
new Replaceable<>("%name%", name)
);
}
}Use these methods most often:
send(...)for a localized message by path.sendRaw(...)for an already assembled message.sendList(...)for multi-line message paths.
BaseMessageService handles placeholder replacement and color-code conversion so your language files stay readable while output stays consistent.