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 at
BuiltinRegistries.MESSAGE_TYPE
. 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 official rm
intermediary net/minecraft/class_2556
named net/minecraft/network/message/MessageType
official j
intermediary comp_792
named chat
official k
intermediary comp_794
named narration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A record holding the message type and the decoration parameters.static final record
The serialized version ofMessageType.Parameters
that is used in packets. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Decoration
The field for thechat
record component.static final RegistryKey<MessageType>
The registry key for the message type used bychat messages
.static final Decoration
static final com.mojang.serialization.Codec<MessageType>
static final RegistryKey<MessageType>
The registry key for the emote command message type, used by /me.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 Decoration
The field for thenarration
record component.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 TypeMethodDescriptionchat()
Returns the value of thechat
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.static RegistryEntry<MessageType>
initialize
(Registry<MessageType> registry) Returns the value of thenarration
record component.static MessageType.Parameters
params
(RegistryKey<MessageType> typeKey, Entity entity) static MessageType.Parameters
params
(RegistryKey<MessageType> typeKey, ServerCommandSource source) static MessageType.Parameters
params
(RegistryKey<MessageType> typeKey, DynamicRegistryManager registryManager, Text name) private static RegistryKey<MessageType>
final String
toString()
Returns a string representation of this record class.
-
Field Details
-
chat
The field for thechat
record component. -
narration
The field for thenarration
record component. -
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lrm;a:Lcom/mojang/serialization/Codec;
intermediary field_39227
Lnet/minecraft/class_2556;field_39227:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/network/message/MessageType;CODEC:Lcom/mojang/serialization/Codec;
-
CHAT_TEXT_DECORATION
- Mappings:
Namespace Name Mixin selector official b
Lrm;b:Lrn;
intermediary field_39677
Lnet/minecraft/class_2556;field_39677:Lnet/minecraft/class_7463;
named CHAT_TEXT_DECORATION
Lnet/minecraft/network/message/MessageType;CHAT_TEXT_DECORATION:Lnet/minecraft/text/Decoration;
-
CHAT
The registry key for the message type used bychat messages
. The message content is decorated using thechat.type.text
text.- Mappings:
Namespace Name Mixin selector official c
Lrm;c:Laba;
intermediary field_11737
Lnet/minecraft/class_2556;field_11737:Lnet/minecraft/class_5321;
named CHAT
Lnet/minecraft/network/message/MessageType;CHAT:Lnet/minecraft/util/registry/RegistryKey;
-
SAY_COMMAND
The registry key for the say command message type, used by /say. The message content is decorated using thechat.type.announcement
text.- Mappings:
Namespace Name Mixin selector official d
Lrm;d:Laba;
intermediary field_39228
Lnet/minecraft/class_2556;field_39228:Lnet/minecraft/class_5321;
named SAY_COMMAND
Lnet/minecraft/network/message/MessageType;SAY_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
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.incoming
text.An incoming message is a private message received from the sender.
- Mappings:
Namespace Name Mixin selector official e
Lrm;e:Laba;
intermediary field_39799
Lnet/minecraft/class_2556;field_39799:Lnet/minecraft/class_5321;
named MSG_COMMAND_INCOMING
Lnet/minecraft/network/message/MessageType;MSG_COMMAND_INCOMING:Lnet/minecraft/util/registry/RegistryKey;
-
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.outgoing
text.An outgoing message is a message that the private message's sender sees in the chat.
- Mappings:
Namespace Name Mixin selector official f
Lrm;f:Laba;
intermediary field_39800
Lnet/minecraft/class_2556;field_39800:Lnet/minecraft/class_5321;
named MSG_COMMAND_OUTGOING
Lnet/minecraft/network/message/MessageType;MSG_COMMAND_OUTGOING:Lnet/minecraft/util/registry/RegistryKey;
-
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.text
text.An incoming message is a team message received from the sender.
- Mappings:
Namespace Name Mixin selector official g
Lrm;g:Laba;
intermediary field_39881
Lnet/minecraft/class_2556;field_39881:Lnet/minecraft/class_5321;
named TEAM_MSG_COMMAND_INCOMING
Lnet/minecraft/network/message/MessageType;TEAM_MSG_COMMAND_INCOMING:Lnet/minecraft/util/registry/RegistryKey;
-
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.sent
text.An outgoing message is a message that the team message's sender sees in the chat.
- Mappings:
Namespace Name Mixin selector official h
Lrm;h:Laba;
intermediary field_39882
Lnet/minecraft/class_2556;field_39882:Lnet/minecraft/class_5321;
named TEAM_MSG_COMMAND_OUTGOING
Lnet/minecraft/network/message/MessageType;TEAM_MSG_COMMAND_OUTGOING:Lnet/minecraft/util/registry/RegistryKey;
-
EMOTE_COMMAND
The registry key for the emote command message type, used by /me. The message content is decorated using thechat.type.emote
text.- Mappings:
Namespace Name Mixin selector official i
Lrm;i:Laba;
intermediary field_39231
Lnet/minecraft/class_2556;field_39231:Lnet/minecraft/class_5321;
named EMOTE_COMMAND
Lnet/minecraft/network/message/MessageType;EMOTE_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
-
Constructor Details
-
MessageType
-
-
Method Details
-
register
- Mappings:
Namespace Name Mixin selector official a
Lrm;a(Ljava/lang/String;)Laba;
intermediary method_43845
Lnet/minecraft/class_2556;method_43845(Ljava/lang/String;)Lnet/minecraft/class_5321;
named register
Lnet/minecraft/network/message/MessageType;register(Ljava/lang/String;)Lnet/minecraft/util/registry/RegistryKey;
-
initialize
- Mappings:
Namespace Name Mixin selector official a
Lrm;a(Lhm;)Lhc;
intermediary method_43844
Lnet/minecraft/class_2556;method_43844(Lnet/minecraft/class_2378;)Lnet/minecraft/class_6880;
named initialize
Lnet/minecraft/network/message/MessageType;initialize(Lnet/minecraft/util/registry/Registry;)Lnet/minecraft/util/registry/RegistryEntry;
-
params
- Mappings:
Namespace Name Mixin selector official a
Lrm;a(Laba;Lbbn;)Lrm$a;
intermediary method_44832
Lnet/minecraft/class_2556;method_44832(Lnet/minecraft/class_5321;Lnet/minecraft/class_1297;)Lnet/minecraft/class_2556$class_7602;
named params
Lnet/minecraft/network/message/MessageType;params(Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/entity/Entity;)Lnet/minecraft/network/message/MessageType$Parameters;
-
params
public static MessageType.Parameters params(RegistryKey<MessageType> typeKey, ServerCommandSource source) - Mappings:
Namespace Name Mixin selector official a
Lrm;a(Laba;Ldr;)Lrm$a;
intermediary method_44833
Lnet/minecraft/class_2556;method_44833(Lnet/minecraft/class_5321;Lnet/minecraft/class_2168;)Lnet/minecraft/class_2556$class_7602;
named params
Lnet/minecraft/network/message/MessageType;params(Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/server/command/ServerCommandSource;)Lnet/minecraft/network/message/MessageType$Parameters;
-
params
public static MessageType.Parameters params(RegistryKey<MessageType> typeKey, DynamicRegistryManager registryManager, Text name) - Mappings:
Namespace Name Mixin selector official a
Lrm;a(Laba;Lhn;Lrq;)Lrm$a;
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;
named params
Lnet/minecraft/network/message/MessageType;params(Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/util/registry/DynamicRegistryManager;Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/MessageType$Parameters;
-
params
- Mappings:
Namespace Name Mixin selector official a
Lrm;a(Lrq;)Lrm$a;
intermediary method_44835
Lnet/minecraft/class_2556;method_44835(Lnet/minecraft/class_2561;)Lnet/minecraft/class_2556$class_7602;
named params
Lnet/minecraft/network/message/MessageType;params(Lnet/minecraft/text/Text;)Lnet/minecraft/network/message/MessageType$Parameters;
-
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 thechat
record component.- Returns:
- the value of the
chat
record component
-
narration
Returns the value of thenarration
record component.- Returns:
- the value of the
narration
record component
-