Package net.minecraft.network.message
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 hudnarration- the narration rule for the content
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/MessageTypeintermediary net/minecraft/class_2556official xrnamed chatintermediary comp_792official lnamed narrationintermediary comp_794official m
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA record holding the message type and the decoration parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final DecorationThe field for thechatrecord component.static final RegistryKey<MessageType> The registry key for the message type used bychat messages.static final Decorationstatic final com.mojang.serialization.Codec<MessageType> static final RegistryKey<MessageType> The registry key for the emote command message type, used by /me.static final PacketCodec<RegistryByteBuf, RegistryEntry<MessageType>> static final RegistryKey<MessageType> The registry key for the incoming message command message type, used by /msg.static final RegistryKey<MessageType> The registry key for the outgoing message command message type, used by /msg.private final DecorationThe field for thenarrationrecord component.static final PacketCodec<RegistryByteBuf, MessageType> static final RegistryKey<MessageType> The registry key for the say command message type, used by /say.static final RegistryKey<MessageType> The registry key for the incoming team message command message type, used by /teammsg.static final RegistryKey<MessageType> The registry key for the outgoing team message command message type, used by /teammsg. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidbootstrap(Registerable<MessageType> messageTypeRegisterable) chat()Returns the value of thechatrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenarrationrecord component.static MessageType.Parametersparams(RegistryKey<MessageType> typeKey, Entity entity) static MessageType.Parametersparams(RegistryKey<MessageType> typeKey, DynamicRegistryManager registryManager, Text name) static MessageType.Parametersparams(RegistryKey<MessageType> typeKey, ServerCommandSource source) private static RegistryKey<MessageType> final StringtoString()Returns a string representation of this record class.
-
Field Details
-
chat
The field for thechatrecord component. -
narration
The field for thenarrationrecord component. -
CODEC
- Mappings:
Namespace Name Mixin selector named CODECLnet/minecraft/network/message/MessageType;CODEC:Lcom/mojang/serialization/Codec;intermediary field_39227Lnet/minecraft/class_2556;field_39227:Lcom/mojang/serialization/Codec;official aLxr;a:Lcom/mojang/serialization/Codec;
-
PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named PACKET_CODECLnet/minecraft/network/message/MessageType;PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_51969Lnet/minecraft/class_2556;field_51969:Lnet/minecraft/class_9139;official bLxr;b:Lzt;
-
ENTRY_PACKET_CODEC
- Mappings:
Namespace Name Mixin selector named ENTRY_PACKET_CODECLnet/minecraft/network/message/MessageType;ENTRY_PACKET_CODEC:Lnet/minecraft/network/codec/PacketCodec;intermediary field_51970Lnet/minecraft/class_2556;field_51970:Lnet/minecraft/class_9139;official cLxr;c:Lzt;
-
CHAT_TEXT_DECORATION
- Mappings:
Namespace Name Mixin selector named CHAT_TEXT_DECORATIONLnet/minecraft/network/message/MessageType;CHAT_TEXT_DECORATION:Lnet/minecraft/text/Decoration;intermediary field_39677Lnet/minecraft/class_2556;field_39677:Lnet/minecraft/class_7463;official dLxr;d:Lxs;
-
CHAT
The registry key for the message type used bychat messages. The message content is decorated using thechat.type.texttext.- Mappings:
Namespace Name Mixin selector named CHATLnet/minecraft/network/message/MessageType;CHAT:Lnet/minecraft/registry/RegistryKey;intermediary field_11737Lnet/minecraft/class_2556;field_11737:Lnet/minecraft/class_5321;official eLxr;e:Laly;
-
SAY_COMMAND
The registry key for the say command message type, used by /say. The message content is decorated using thechat.type.announcementtext.- Mappings:
Namespace Name Mixin selector named SAY_COMMANDLnet/minecraft/network/message/MessageType;SAY_COMMAND:Lnet/minecraft/registry/RegistryKey;intermediary field_39228Lnet/minecraft/class_2556;field_39228:Lnet/minecraft/class_5321;official fLxr;f:Laly;
-
MSG_COMMAND_INCOMING
The registry key for the incoming message command message type, used by /msg. The message content is decorated using thecommands.message.display.incomingtext.An incoming message is a private message received from the sender.
- Mappings:
Namespace Name Mixin selector named MSG_COMMAND_INCOMINGLnet/minecraft/network/message/MessageType;MSG_COMMAND_INCOMING:Lnet/minecraft/registry/RegistryKey;intermediary field_39799Lnet/minecraft/class_2556;field_39799:Lnet/minecraft/class_5321;official gLxr;g:Laly;
-
MSG_COMMAND_OUTGOING
The registry key for the outgoing message command message type, used by /msg. The message content is decorated using thecommands.message.display.outgoingtext.An outgoing message is a message that the private message's sender sees in the chat.
- Mappings:
Namespace Name Mixin selector named MSG_COMMAND_OUTGOINGLnet/minecraft/network/message/MessageType;MSG_COMMAND_OUTGOING:Lnet/minecraft/registry/RegistryKey;intermediary field_39800Lnet/minecraft/class_2556;field_39800:Lnet/minecraft/class_5321;official hLxr;h:Laly;
-
TEAM_MSG_COMMAND_INCOMING
The registry key for the incoming team message command message type, used by /teammsg. The message content is decorated using thechat.type.team.texttext.An incoming message is a team message received from the sender.
- Mappings:
Namespace Name Mixin selector named TEAM_MSG_COMMAND_INCOMINGLnet/minecraft/network/message/MessageType;TEAM_MSG_COMMAND_INCOMING:Lnet/minecraft/registry/RegistryKey;intermediary field_39881Lnet/minecraft/class_2556;field_39881:Lnet/minecraft/class_5321;official iLxr;i:Laly;
-
TEAM_MSG_COMMAND_OUTGOING
The registry key for the outgoing team message command message type, used by /teammsg. The message content is decorated using thechat.type.team.senttext.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_OUTGOINGLnet/minecraft/network/message/MessageType;TEAM_MSG_COMMAND_OUTGOING:Lnet/minecraft/registry/RegistryKey;intermediary field_39882Lnet/minecraft/class_2556;field_39882:Lnet/minecraft/class_5321;official jLxr;j:Laly;
-
EMOTE_COMMAND
The registry key for the emote command message type, used by /me. The message content is decorated using thechat.type.emotetext.- Mappings:
Namespace Name Mixin selector named EMOTE_COMMANDLnet/minecraft/network/message/MessageType;EMOTE_COMMAND:Lnet/minecraft/registry/RegistryKey;intermediary field_39231Lnet/minecraft/class_2556;field_39231:Lnet/minecraft/class_5321;official kLxr;k:Laly;
-
-
Constructor Details
-
MessageType
-
-
Method Details
-
register
- Mappings:
Namespace Name Mixin selector named registerLnet/minecraft/network/message/MessageType;register(Ljava/lang/String;)Lnet/minecraft/registry/RegistryKey;intermediary method_43845Lnet/minecraft/class_2556;method_43845(Ljava/lang/String;)Lnet/minecraft/class_5321;official aLxr;a(Ljava/lang/String;)Laly;
-
bootstrap
- Mappings:
Namespace Name Mixin selector named bootstrapLnet/minecraft/network/message/MessageType;bootstrap(Lnet/minecraft/registry/Registerable;)Vintermediary method_43844Lnet/minecraft/class_2556;method_43844(Lnet/minecraft/class_7891;)Vofficial aLxr;a(Lrk;)V
-
params
- Mappings:
Namespace Name Mixin selector named paramsLnet/minecraft/network/message/MessageType;params(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/entity/Entity;)Lnet/minecraft/network/message/MessageType$Parameters;intermediary method_44832Lnet/minecraft/class_2556;method_44832(Lnet/minecraft/class_5321;Lnet/minecraft/class_1297;)Lnet/minecraft/class_2556$class_7602;official aLxr;a(Laly;Lbvj;)Lxr$a;
-
params
public static MessageType.Parameters params(RegistryKey<MessageType> typeKey, ServerCommandSource source) - Mappings:
Namespace Name Mixin selector named paramsLnet/minecraft/network/message/MessageType;params(Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/server/command/ServerCommandSource;)Lnet/minecraft/network/message/MessageType$Parameters;intermediary method_44833Lnet/minecraft/class_2556;method_44833(Lnet/minecraft/class_5321;Lnet/minecraft/class_2168;)Lnet/minecraft/class_2556$class_7602;official aLxr;a(Laly;Lew;)Lxr$a;
-
params
public static MessageType.Parameters params(RegistryKey<MessageType> typeKey, DynamicRegistryManager registryManager, Text name) - Mappings:
Namespace Name Mixin selector named paramsLnet/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_44834Lnet/minecraft/class_2556;method_44834(Lnet/minecraft/class_5321;Lnet/minecraft/class_5455;Lnet/minecraft/class_2561;)Lnet/minecraft/class_2556$class_7602;official aLxr;a(Laly;Lke;Lxv;)Lxr$a;
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
chat
Returns the value of thechatrecord component.- Returns:
- the value of the
chatrecord component
-
narration
Returns the value of thenarrationrecord component.- Returns:
- the value of the
narrationrecord component
-