Interface ServerMessageEvents.CommandMessage

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.

@FunctionalInterface public static interface ServerMessageEvents.CommandMessage
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onCommandMessage(net.minecraft.server.filter.FilteredMessage<net.minecraft.network.message.SignedMessage> message, net.minecraft.server.command.ServerCommandSource source, net.minecraft.util.registry.RegistryKey<net.minecraft.network.message.MessageType> typeKey)
    Called when the server broadcasts a command message to all players, such as one from /me, /msg, /say, and /tellraw.
  • Method Details

    • onCommandMessage

      void onCommandMessage(net.minecraft.server.filter.FilteredMessage<net.minecraft.network.message.SignedMessage> message, net.minecraft.server.command.ServerCommandSource source, net.minecraft.util.registry.RegistryKey<net.minecraft.network.message.MessageType> typeKey)
      Called when the server broadcasts a command message to all players, such as one from /me, /msg, /say, and /tellraw. Is not called when command messages are blocked.

      If the command is executed by a player, ServerMessageEvents.ALLOW_CHAT_MESSAGE and ServerMessageEvents.CHAT_MESSAGE events will also be triggered after this event.

      Parameters:
      message - the broadcast message with message decorators applied if applicable; use message.raw().getContent() to get the text
      source - the command source that sent the message
      typeKey - the message type