Interface MessageSender
public interface MessageSender
Sends chat messages to players and console with proper version compatibility.
Usage example:
MessageSender messageSender = flectonePulse.get(MessageSender.class);
// Send message to player
messageSender.sendMessage(player, Component.text("Hello!"), false);
// Send message to console
messageSender.sendToConsole(Component.text("Server message"));
- Since:
- 1.2.0
-
Method Summary
Modifier and TypeMethodDescriptionvoidsendMessage(FPlayer fPlayer, net.kyori.adventure.text.Component component, boolean silent) Sends a chat message to a player.voidsendToConsole(String message) Sends a formatted message to the server console.voidsendToConsole(net.kyori.adventure.text.Component component) Sends a formatted message to the server console.
-
Method Details
-
sendToConsole
Sends a formatted message to the server console.- Parameters:
message- the message to send to console
-
sendToConsole
void sendToConsole(net.kyori.adventure.text.Component component) Sends a formatted message to the server console.- Parameters:
component- the component to send to console
-
sendMessage
Sends a chat message to a player.- Parameters:
fPlayer- the player or console to receive the messagecomponent- the message component to sendsilent- whether to send the packet silently
-