Record Class MessageType

java.lang.Object
java.lang.Record
net.minecraft.network.message.MessageType
Record Components:
chat - the display rule for the content displayed in the chat hud
narration - the narration rule for the content

public record MessageType(Decoration chat, Decoration narration) extends Record
A message type (also known as "chat type") controls how to display or narrate the chat messages sent to the clients. Message types are registered using data packs. When sending a chat message, the registry key of the message type can be passed to indicate which message type should be used.

Message type has two fields.

The fields are "decoration", which is an instance of Decoration. Decorations are pre-defined message formatting and styling rules, which can be applied to the message to produce the displayed or narrated text.

Mappings:
Namespace Name
named net/minecraft/network/message/MessageType
intermediary net/minecraft/class_2556
official wv
named chat
intermediary comp_792
official l
named narration
intermediary comp_794
official m
  • Field Details

    • chat

      private final Decoration chat
      The field for the chat record component.
    • narration

      private final Decoration narration
      The field for the narration record component.
    • CODEC

      public static final com.mojang.serialization.Codec<MessageType> CODEC
      Mappings:
      Namespace Name Mixin selector
      named CODEC Lnet/minecraft/network/message/MessageType;CODEC:Lcom/mojang/serialization/Codec;
      intermediary field_39227 Lnet/minecraft/class_2556;field_39227:Lcom/mojang/serialization/Codec;
      official a Lwv;a:Lcom/mojang/serialization/Codec;
    • PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,MessageType> PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named PACKET_CODEC Lnet/minecraft/network/message/MessageType;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_51969 Lnet/minecraft/class_2556;field_51969:Lnet/minecraft/class_9139;
      official b Lwv;b:Lyx;
    • ENTRY_PACKET_CODEC

      public static final PacketCodec<RegistryByteBuf,RegistryEntry<MessageType>> ENTRY_PACKET_CODEC
      Mappings:
      Namespace Name Mixin selector
      named ENTRY_PACKET_CODEC Lnet/minecraft/network/message/MessageType;ENTRY_PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;
      intermediary field_51970 Lnet/minecraft/class_2556;field_51970:Lnet/minecraft/class_9139;
      official c Lwv;c:Lyx;
    • CHAT_TEXT_DECORATION

      public static final Decoration CHAT_TEXT_DECORATION
      Mappings:
      Namespace Name Mixin selector
      named CHAT_TEXT_DECORATION Lnet/minecraft/network/message/MessageType;CHAT_TEXT_DECORATION:Lnet/minecraft/text/Decoration;
      intermediary field_39677 Lnet/minecraft/class_2556;field_39677:Lnet/minecraft/class_7463;
      official d Lwv;d:Lww;
    • CHAT

      public static final RegistryKey<MessageType> CHAT
      The registry key for the message type used by chat messages. The message content is decorated using the chat.type.text text.
      Mappings:
      Namespace Name Mixin selector
      named CHAT Lnet/minecraft/network/message/MessageType;CHAT:Lnet/minecraft/registry/RegistryKey;
      intermediary field_11737 Lnet/minecraft/class_2556;field_11737:Lnet/minecraft/class_5321;
      official e Lwv;e:Lakq;
    • SAY_COMMAND

      public static final RegistryKey<MessageType> SAY_COMMAND
      The registry key for the say command message type, used by /say. The message content is decorated using the chat.type.announcement text.
      Mappings:
      Namespace Name Mixin selector
      named SAY_COMMAND Lnet/minecraft/network/message/MessageType;SAY_COMMAND:Lnet/minecraft/registry/RegistryKey;
      intermediary field_39228 Lnet/minecraft/class_2556;field_39228:Lnet/minecraft/class_5321;
      official f Lwv;f:Lakq;
    • MSG_COMMAND_INCOMING

      public static final RegistryKey<MessageType> MSG_COMMAND_INCOMING
      The registry key for the incoming message command message type, used by /msg. The message content is decorated using the commands.message.display.incoming text.

      An incoming message is a private message received from the sender.

      Mappings:
      Namespace Name Mixin selector
      named MSG_COMMAND_INCOMING Lnet/minecraft/network/message/MessageType;MSG_COMMAND_INCOMING:Lnet/minecraft/registry/RegistryKey;
      intermediary field_39799 Lnet/minecraft/class_2556;field_39799:Lnet/minecraft/class_5321;
      official g Lwv;g:Lakq;
    • MSG_COMMAND_OUTGOING

      public static final RegistryKey<MessageType> MSG_COMMAND_OUTGOING
      The registry key for the outgoing message command message type, used by /msg. The message content is decorated using the commands.message.display.outgoing text.

      An outgoing message is a message that the private message's sender sees in the chat.

      Mappings:
      Namespace Name Mixin selector
      named MSG_COMMAND_OUTGOING Lnet/minecraft/network/message/MessageType;MSG_COMMAND_OUTGOING:Lnet/minecraft/registry/RegistryKey;
      intermediary field_39800 Lnet/minecraft/class_2556;field_39800:Lnet/minecraft/class_5321;
      official h Lwv;h:Lakq;
    • TEAM_MSG_COMMAND_INCOMING

      public static final RegistryKey<MessageType> TEAM_MSG_COMMAND_INCOMING
      The registry key for the incoming team message command message type, used by /teammsg. The message content is decorated using the chat.type.team.text text.

      An incoming message is a team message received from the sender.

      Mappings:
      Namespace Name Mixin selector
      named TEAM_MSG_COMMAND_INCOMING Lnet/minecraft/network/message/MessageType;TEAM_MSG_COMMAND_INCOMING:Lnet/minecraft/registry/RegistryKey;
      intermediary field_39881 Lnet/minecraft/class_2556;field_39881:Lnet/minecraft/class_5321;
      official i Lwv;i:Lakq;
    • TEAM_MSG_COMMAND_OUTGOING

      public static final RegistryKey<MessageType> TEAM_MSG_COMMAND_OUTGOING
      The registry key for the outgoing team message command message type, used by /teammsg. The message content is decorated using the chat.type.team.sent text.

      An outgoing message is a message that the team message's sender sees in the chat.

      Mappings:
      Namespace Name Mixin selector
      named TEAM_MSG_COMMAND_OUTGOING Lnet/minecraft/network/message/MessageType;TEAM_MSG_COMMAND_OUTGOING:Lnet/minecraft/registry/RegistryKey;
      intermediary field_39882 Lnet/minecraft/class_2556;field_39882:Lnet/minecraft/class_5321;
      official j Lwv;j:Lakq;
    • EMOTE_COMMAND

      public static final RegistryKey<MessageType> EMOTE_COMMAND
      The registry key for the emote command message type, used by /me. The message content is decorated using the chat.type.emote text.
      Mappings:
      Namespace Name Mixin selector
      named EMOTE_COMMAND Lnet/minecraft/network/message/MessageType;EMOTE_COMMAND:Lnet/minecraft/registry/RegistryKey;
      intermediary field_39231 Lnet/minecraft/class_2556;field_39231:Lnet/minecraft/class_5321;
      official k Lwv;k:Lakq;
  • Constructor Details

  • Method Details

    • register

      private static RegistryKey<MessageType> register(String id)
      Mappings:
      Namespace Name Mixin selector
      named register Lnet/minecraft/network/message/MessageType;register(Ljava/lang/String;)Lnet/minecraft/registry/RegistryKey;
      intermediary method_43845 Lnet/minecraft/class_2556;method_43845(Ljava/lang/String;)Lnet/minecraft/class_5321;
      official a Lwv;a(Ljava/lang/String;)Lakq;
    • bootstrap

      public static void bootstrap(Registerable<MessageType> messageTypeRegisterable)
      Mappings:
      Namespace Name Mixin selector
      named bootstrap Lnet/minecraft/network/message/MessageType;bootstrap(Lnet/minecraft/registry/Registerable;)V
      intermediary method_43844 Lnet/minecraft/class_2556;method_43844(Lnet/minecraft/class_7891;)V
      official a Lwv;a(Lqq;)V
    • params

      public static MessageType.Parameters params(RegistryKey<MessageType> typeKey, Entity entity)
      Mappings:
      Namespace Name Mixin selector
      named params Lnet/minecraft/network/message/MessageType;params(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/entity/Entity;)Lnet/minecraft/network/message/MessageType$Parameters;
      intermediary method_44832 Lnet/minecraft/class_2556;method_44832(Lnet/minecraft/class_5321;Lnet/minecraft/class_1297;)Lnet/minecraft/class_2556$class_7602;
      official a Lwv;a(Lakq;Lbsr;)Lwv$a;
    • params

      public static MessageType.Parameters params(RegistryKey<MessageType> typeKey, ServerCommandSource source)
      Mappings:
      Namespace Name Mixin selector
      named params Lnet/minecraft/network/message/MessageType;params(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/server/command/ServerCommandSource;)Lnet/minecraft/network/message/MessageType$Parameters;
      intermediary method_44833 Lnet/minecraft/class_2556;method_44833(Lnet/minecraft/class_5321;Lnet/minecraft/class_2168;)Lnet/minecraft/class_2556$class_7602;
      official a Lwv;a(Lakq;Let;)Lwv$a;
    • params

      public static MessageType.Parameters params(RegistryKey<MessageType> typeKey, DynamicRegistryManager registryManager, Text name)
      Mappings:
      Namespace Name Mixin selector
      named params Lnet/minecraft/network/message/MessageType;params(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/registry/DynamicRegistryManager;Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/MessageType$Parameters;
      intermediary method_44834 Lnet/minecraft/class_2556;method_44834(Lnet/minecraft/class_5321;Lnet/minecraft/class_5455;Lnet/minecraft/class_2561;)Lnet/minecraft/class_2556$class_7602;
      official a Lwv;a(Lakq;Lka;Lwz;)Lwv$a;
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object object)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      object - the object with which to compare
      Returns:
      true if this object is the same as the object argument; false otherwise.
    • chat

      public Decoration chat()
      Returns the value of the chat record component.
      Returns:
      the value of the chat record component
    • narration

      public Decoration narration()
      Returns the value of the narration record component.
      Returns:
      the value of the narration record component