Interface ReceivedMessage

All Known Implementing Classes:
ReceivedMessage.ChatMessage, ReceivedMessage.GameMessage

@Environment(CLIENT) public interface ReceivedMessage
A message received by the client and stored in ChatLog.

This includes both chat messages and game messages.

Mappings:
Namespace Name
official eul
intermediary net/minecraft/class_7557
named net/minecraft/client/report/ReceivedMessage
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    A chat message received by the client.
    static final record 
    A game message received by the client.
    static final record 
    A pair of the message's index and the message itself.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the content of the message.
    default Text
    Returns the narration of the message (by default, the content).
    boolean
    Returns whether the sender's UUID equals uuid.
    of(com.mojang.authlib.GameProfile gameProfile, Text displayName, SignedMessage message)
    Returns the received message constructed from a chat message's elements.
    of(Text message, Instant timestamp)
    Returns the received message constructed from a game message's elements.
  • Method Details

    • of

      static ReceivedMessage of(com.mojang.authlib.GameProfile gameProfile, Text displayName, SignedMessage message)
      Returns the received message constructed from a chat message's elements.
      Parameters:
      gameProfile - the game profile of the message's sender
      displayName - the displayed name of the sender
      message - the message content
      Returns:
      the received message constructed from a chat message's elements
      Mappings:
      Namespace Name Mixin selector
      official a Leul;a(Lcom/mojang/authlib/GameProfile;Lrm;Lru;)Leul;
      intermediary method_44552 Lnet/minecraft/class_7557;method_44552(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/class_2561;Lnet/minecraft/class_7471;)Lnet/minecraft/class_7557;
      named of Lnet/minecraft/client/report/ReceivedMessage;of(Lcom/mojang/authlib/GameProfile;Lnet/minecraft/text/Text;Lnet/minecraft/network/message/SignedMessage;)Lnet/minecraft/client/report/ReceivedMessage;
    • of

      static ReceivedMessage of(Text message, Instant timestamp)
      Returns the received message constructed from a game message's elements.
      Parameters:
      message - the message content
      timestamp - the timestamp of the message
      Returns:
      the received message constructed from a game message's elements
      Mappings:
      Namespace Name Mixin selector
      official a Leul;a(Lrm;Ljava/time/Instant;)Leul;
      intermediary method_44554 Lnet/minecraft/class_7557;method_44554(Lnet/minecraft/class_2561;Ljava/time/Instant;)Lnet/minecraft/class_7557;
      named of Lnet/minecraft/client/report/ReceivedMessage;of(Lnet/minecraft/text/Text;Ljava/time/Instant;)Lnet/minecraft/client/report/ReceivedMessage;
    • getContent

      Text getContent()
      Returns the content of the message.
      Returns:
      the content of the message
      Implementation Note:
      If the message is a chat message and it contains an unsigned part, the unsigned part will be returned. Note that in vanilla, unsigned part is stripped prior to construction of the received message instance if the client requires secure chat.
      Mappings:
      Namespace Name Mixin selector
      official a Leul;a()Lrm;
      intermediary method_44551 Lnet/minecraft/class_7557;method_44551()Lnet/minecraft/class_2561;
      named getContent Lnet/minecraft/client/report/ReceivedMessage;getContent()Lnet/minecraft/text/Text;
    • getNarration

      default Text getNarration()
      Returns the narration of the message (by default, the content).
      Returns:
      the narration of the message (by default, the content)
      Mappings:
      Namespace Name Mixin selector
      official b Leul;b()Lrm;
      intermediary method_44555 Lnet/minecraft/class_7557;method_44555()Lnet/minecraft/class_2561;
      named getNarration Lnet/minecraft/client/report/ReceivedMessage;getNarration()Lnet/minecraft/text/Text;
    • isSentFrom

      boolean isSentFrom(UUID uuid)
      Returns whether the sender's UUID equals uuid.
      Returns:
      whether the sender's UUID equals uuid
      Mappings:
      Namespace Name Mixin selector
      official a Leul;a(Ljava/util/UUID;)Z
      intermediary method_44553 Lnet/minecraft/class_7557;method_44553(Ljava/util/UUID;)Z
      named isSentFrom Lnet/minecraft/client/report/ReceivedMessage;isSentFrom(Ljava/util/UUID;)Z