Package net.minecraft.network
Record Class MessageType
java.lang.Object
java.lang.Record
net.minecraft.network.MessageType
- Record Components:
chat- the display rule of a message to the chat hud, orOptional.empty()if it is not displayedoverlay- the display rule of a message to the in-game hud overlay, orOptional.empty()if it is not displayednarration- the narration rule of a message, orOptional.empty()if it is not narrated
public record MessageType(Optional<MessageType.DisplayRule> chat, Optional<MessageType.DisplayRule> overlay, Optional<MessageType.NarrationRule> narration)
extends Record
A message type, or chat type in registry, or chat style format per
Minecraft blog, defines how a piece of text content should be rendered.
It can direct messages to the chat hud, the in-game hud overlay, and the
narrator, and format them with the sender information.
- Mappings:
Namespace Name official rcintermediary net/minecraft/class_2556named net/minecraft/network/MessageTypeofficial jintermediary comp_792named chatofficial kintermediary comp_793named overlayofficial lintermediary comp_794named narration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordA display rule for a message.static final recordA narration rule for a message. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<MessageType.DisplayRule>The field for thechatrecord component.static final RegistryKey<MessageType>static final com.mojang.serialization.Codec<MessageType>The codec for the message type.static final RegistryKey<MessageType>static final RegistryKey<MessageType>static final RegistryKey<MessageType>private final Optional<MessageType.NarrationRule>The field for thenarrationrecord component.private final Optional<MessageType.DisplayRule>The field for theoverlayrecord component.static final RegistryKey<MessageType>static final RegistryKey<MessageType>static final RegistryKey<MessageType>static final RegistryKey<MessageType> -
Constructor Summary
ConstructorsConstructorDescriptionMessageType(Optional<MessageType.DisplayRule> optional, Optional<MessageType.DisplayRule> optional2, Optional<MessageType.NarrationRule> optional3) -
Method Summary
Modifier and TypeMethodDescriptionchat()Returns the value of thechatrecord component.final booleanIndicates whether some other object is "equal to" this one.private static RegistryKey<MessageType>final inthashCode()Returns a hash code value for this object.Returns the value of thenarrationrecord component.overlay()Returns the value of theoverlayrecord component.static MessageTyperegisterAndGetDefault(Registry<MessageType> registry) Registers the built-in message types and returns the default "chat" type.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
chat
The field for thechatrecord component. -
overlay
The field for theoverlayrecord component. -
narration
The field for thenarrationrecord component. -
CODEC
The codec for the message type.- Mappings:
Namespace Name Mixin selector official aLrc;a:Lcom/mojang/serialization/Codec;intermediary field_39227Lnet/minecraft/class_2556;field_39227:Lcom/mojang/serialization/Codec;named CODECLnet/minecraft/network/MessageType;CODEC:Lcom/mojang/serialization/Codec;
-
CHAT
- Mappings:
Namespace Name Mixin selector official bLrc;b:Lzx;intermediary field_11737Lnet/minecraft/class_2556;field_11737:Lnet/minecraft/class_5321;named CHATLnet/minecraft/network/MessageType;CHAT:Lnet/minecraft/util/registry/RegistryKey;
-
SYSTEM
- Mappings:
Namespace Name Mixin selector official cLrc;c:Lzx;intermediary field_11735Lnet/minecraft/class_2556;field_11735:Lnet/minecraft/class_5321;named SYSTEMLnet/minecraft/network/MessageType;SYSTEM:Lnet/minecraft/util/registry/RegistryKey;
-
GAME_INFO
- Mappings:
Namespace Name Mixin selector official dLrc;d:Lzx;intermediary field_11733Lnet/minecraft/class_2556;field_11733:Lnet/minecraft/class_5321;named GAME_INFOLnet/minecraft/network/MessageType;GAME_INFO:Lnet/minecraft/util/registry/RegistryKey;
-
SAY_COMMAND
- Mappings:
Namespace Name Mixin selector official eLrc;e:Lzx;intermediary field_39228Lnet/minecraft/class_2556;field_39228:Lnet/minecraft/class_5321;named SAY_COMMANDLnet/minecraft/network/MessageType;SAY_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
MSG_COMMAND
- Mappings:
Namespace Name Mixin selector official fLrc;f:Lzx;intermediary field_39229Lnet/minecraft/class_2556;field_39229:Lnet/minecraft/class_5321;named MSG_COMMANDLnet/minecraft/network/MessageType;MSG_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
TEAM_MSG_COMMAND
- Mappings:
Namespace Name Mixin selector official gLrc;g:Lzx;intermediary field_39230Lnet/minecraft/class_2556;field_39230:Lnet/minecraft/class_5321;named TEAM_MSG_COMMANDLnet/minecraft/network/MessageType;TEAM_MSG_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
EMOTE_COMMAND
- Mappings:
Namespace Name Mixin selector official hLrc;h:Lzx;intermediary field_39231Lnet/minecraft/class_2556;field_39231:Lnet/minecraft/class_5321;named EMOTE_COMMANDLnet/minecraft/network/MessageType;EMOTE_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
TELLRAW_COMMAND
- Mappings:
Namespace Name Mixin selector official iLrc;i:Lzx;intermediary field_39232Lnet/minecraft/class_2556;field_39232:Lnet/minecraft/class_5321;named TELLRAW_COMMANDLnet/minecraft/network/MessageType;TELLRAW_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
-
Constructor Details
-
MessageType
public MessageType(Optional<MessageType.DisplayRule> optional, Optional<MessageType.DisplayRule> optional2, Optional<MessageType.NarrationRule> optional3)
-
-
Method Details
-
getKey
- Mappings:
Namespace Name Mixin selector official aLrc;a(Ljava/lang/String;)Lzx;intermediary method_43845Lnet/minecraft/class_2556;method_43845(Ljava/lang/String;)Lnet/minecraft/class_5321;named getKeyLnet/minecraft/network/MessageType;getKey(Ljava/lang/String;)Lnet/minecraft/util/registry/RegistryKey;
-
registerAndGetDefault
Registers the built-in message types and returns the default "chat" type.- Mappings:
Namespace Name Mixin selector official aLrc;a(Lhi;)Lrc;intermediary method_43844Lnet/minecraft/class_2556;method_43844(Lnet/minecraft/class_2378;)Lnet/minecraft/class_2556;named registerAndGetDefaultLnet/minecraft/network/MessageType;registerAndGetDefault(Lnet/minecraft/util/registry/Registry;)Lnet/minecraft/network/MessageType;
-
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
-
overlay
Returns the value of theoverlayrecord component.- Returns:
- the value of the
overlayrecord component
-
narration
Returns the value of thenarrationrecord component.- Returns:
- the value of the
narrationrecord component
-