Interface ChatEvent.Received

Enclosing interface:
ChatEvent
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 ChatEvent.Received
  • Method Summary

    Modifier and Type
    Method
    Description
    received(@Nullable net.minecraft.server.level.ServerPlayer player, net.minecraft.network.chat.Component component)
    Invoked when the server receives a message from a client.
  • Method Details

    • received

      EventResult received(@Nullable @Nullable net.minecraft.server.level.ServerPlayer player, net.minecraft.network.chat.Component component)
      Invoked when the server receives a message from a client. Equivalent to Forge's ServerChatEvent event.
      Parameters:
      player - The player who has sent the message, or null.
      component - The message as component.
      Returns:
      A EventResult determining the outcome of the event, the execution of the vanilla message may be cancelled by the result.