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 Type
    Method
    Description
    void
    sendMessage(FPlayer fPlayer, net.kyori.adventure.text.Component component, boolean silent)
    Sends a chat message to a player.
    void
    Sends a formatted message to the server console.
    void
    sendToConsole(net.kyori.adventure.text.Component component)
    Sends a formatted message to the server console.
  • Method Details

    • sendToConsole

      void sendToConsole(String message)
      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

      void sendMessage(FPlayer fPlayer, net.kyori.adventure.text.Component component, boolean silent)
      Sends a chat message to a player.
      Parameters:
      fPlayer - the player or console to receive the message
      component - the message component to send
      silent - whether to send the packet silently