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.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanallowReceiveChatMessage(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. Returningfalseprevents the message from being displayed, andClientReceiveMessageEvents.CHAT_CANCELEDwill be triggered instead ofClientReceiveMessageEvents.CHAT.- Parameters:
message- the message received from the serverplayerChatMessage- the signed message received from the server (nullable)sender- the sender of the message (nullable)boundChatType- the parameters of the messagetimeStamp- the timestamp when the message was received- Returns:
trueif the message should be displayed, otherwisefalse
-