Interface ServerMessageEvents.ChatMessage
- Enclosing class:
ServerMessageEvents
- 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 TypeMethodDescriptionvoid
onChatMessage
(net.minecraft.server.filter.FilteredMessage<net.minecraft.network.message.SignedMessage> message, net.minecraft.server.network.ServerPlayerEntity sender, net.minecraft.util.registry.RegistryKey<net.minecraft.network.message.MessageType> typeKey) Called when the server broadcasts a chat message sent by a player, typically from a client GUI or a player-executed command.
-
Method Details
-
onChatMessage
void onChatMessage(net.minecraft.server.filter.FilteredMessage<net.minecraft.network.message.SignedMessage> message, net.minecraft.server.network.ServerPlayerEntity sender, net.minecraft.util.registry.RegistryKey<net.minecraft.network.message.MessageType> typeKey) Called when the server broadcasts a chat message sent by a player, typically from a client GUI or a player-executed command. Is not called when chat messages are blocked.If the message is from a player-executed command, this will be called only if
ServerMessageEvents.ALLOW_COMMAND_MESSAGE
event did not block the message, and after triggeringServerMessageEvents.COMMAND_MESSAGE
event.- Parameters:
message
- the broadcast message with message decorators applied; usemessage.raw().getContent()
to get the textsender
- the player that sent the messagetypeKey
- the message type
-