Interface ServerMessageEvents.AllowCommandMessage
- 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 TypeMethodDescriptionbooleanallowCommandMessage(net.minecraft.network.chat.PlayerChatMessage message, net.minecraft.commands.CommandSourceStack source, net.minecraft.network.chat.ChatType.Bound boundChatType) Called when the server broadcasts a command message to all players, such as one from/meand/say(but not ones that specify the recipients like/msg).
-
Method Details
-
allowCommandMessage
boolean allowCommandMessage(net.minecraft.network.chat.PlayerChatMessage message, net.minecraft.commands.CommandSourceStack source, net.minecraft.network.chat.ChatType.Bound boundChatType) Called when the server broadcasts a command message to all players, such as one from/meand/say(but not ones that specify the recipients like/msg). Returningfalseprevents the message from being broadcast and theServerMessageEvents.COMMAND_MESSAGEevent from triggering.If the command is executed by a player and the message is not blocked,
ServerMessageEvents.ALLOW_CHAT_MESSAGEandServerMessageEvents.CHAT_MESSAGEevents will also be triggered after triggeringServerMessageEvents.COMMAND_MESSAGE.- Parameters:
message- the broadcast message with chat decorators applied if applicable; usemessage.decoratedContent()to get the componentsource- the command source that sent the messageboundChatType- theChatType.Bound- Returns:
trueif the message should be broadcast, otherwisefalse
-