Class PlayerChatSender

java.lang.Object
com.petarmc.lib.chat.PlayerChatSender

public final class PlayerChatSender extends Object
Utility class for sending chat messages from the client to the server. This sends messages as if the player typed them (so they are visible to the server and other players). Use from client-only code (GUIs, keybind handlers, etc.).
  • Field Details

  • Constructor Details

    • PlayerChatSender

      private PlayerChatSender()
  • Method Details

    • send

      public static boolean send(String message)
      Send a single chat message from the player to the server. Returns true if the send was attempted, false if aborted.