Interface ClientReceiveMessageEvents.AllowChat

Enclosing class:
ClientReceiveMessageEvents
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public static interface ClientReceiveMessageEvents.AllowChat
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    allowReceiveChatMessage(net.minecraft.network.chat.Component message, @Nullable net.minecraft.network.chat.PlayerChatMessage playerChatMessage, @Nullable com.mojang.authlib.GameProfile sender, net.minecraft.network.chat.ChatType.Bound boundChatType, Instant timeStamp)
    Called when the client receives a chat message, which is any message sent by a player.
  • Method Details

    • allowReceiveChatMessage

      boolean allowReceiveChatMessage(net.minecraft.network.chat.Component message, @Nullable net.minecraft.network.chat.PlayerChatMessage playerChatMessage, @Nullable com.mojang.authlib.GameProfile sender, net.minecraft.network.chat.ChatType.Bound boundChatType, Instant timeStamp)
      Called when the client receives a chat message, which is any message sent by a player. Returning false prevents the message from being displayed, and ClientReceiveMessageEvents.CHAT_CANCELED will be triggered instead of ClientReceiveMessageEvents.CHAT.
      Parameters:
      message - the message received from the server
      playerChatMessage - the signed message received from the server (nullable)
      sender - the sender of the message (nullable)
      boundChatType - the parameters of the message
      timeStamp - the timestamp when the message was received
      Returns:
      true if the message should be displayed, otherwise false