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 rc
intermediary net/minecraft/class_2556
named net/minecraft/network/MessageType
official j
intermediary comp_792
named chat
official k
intermediary comp_793
named overlay
official l
intermediary comp_794
named narration
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final record
A display rule for a message.static final record
A narration rule for a message. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Optional<MessageType.DisplayRule>
The field for thechat
record 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 thenarration
record component.private final Optional<MessageType.DisplayRule>
The field for theoverlay
record 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 thechat
record component.final boolean
Indicates whether some other object is "equal to" this one.private static RegistryKey<MessageType>
final int
hashCode()
Returns a hash code value for this object.Returns the value of thenarration
record component.overlay()
Returns the value of theoverlay
record component.static MessageType
registerAndGetDefault
(Registry<MessageType> registry) Registers the built-in message types and returns the default "chat" type.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
chat
The field for thechat
record component. -
overlay
The field for theoverlay
record component. -
narration
The field for thenarration
record component. -
CODEC
The codec for the message type.- Mappings:
Namespace Name Mixin selector official a
Lrc;a:Lcom/mojang/serialization/Codec;
intermediary field_39227
Lnet/minecraft/class_2556;field_39227:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/network/MessageType;CODEC:Lcom/mojang/serialization/Codec;
-
CHAT
- Mappings:
Namespace Name Mixin selector official b
Lrc;b:Lzx;
intermediary field_11737
Lnet/minecraft/class_2556;field_11737:Lnet/minecraft/class_5321;
named CHAT
Lnet/minecraft/network/MessageType;CHAT:Lnet/minecraft/util/registry/RegistryKey;
-
SYSTEM
- Mappings:
Namespace Name Mixin selector official c
Lrc;c:Lzx;
intermediary field_11735
Lnet/minecraft/class_2556;field_11735:Lnet/minecraft/class_5321;
named SYSTEM
Lnet/minecraft/network/MessageType;SYSTEM:Lnet/minecraft/util/registry/RegistryKey;
-
GAME_INFO
- Mappings:
Namespace Name Mixin selector official d
Lrc;d:Lzx;
intermediary field_11733
Lnet/minecraft/class_2556;field_11733:Lnet/minecraft/class_5321;
named GAME_INFO
Lnet/minecraft/network/MessageType;GAME_INFO:Lnet/minecraft/util/registry/RegistryKey;
-
SAY_COMMAND
- Mappings:
Namespace Name Mixin selector official e
Lrc;e:Lzx;
intermediary field_39228
Lnet/minecraft/class_2556;field_39228:Lnet/minecraft/class_5321;
named SAY_COMMAND
Lnet/minecraft/network/MessageType;SAY_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
MSG_COMMAND
- Mappings:
Namespace Name Mixin selector official f
Lrc;f:Lzx;
intermediary field_39229
Lnet/minecraft/class_2556;field_39229:Lnet/minecraft/class_5321;
named MSG_COMMAND
Lnet/minecraft/network/MessageType;MSG_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
TEAM_MSG_COMMAND
- Mappings:
Namespace Name Mixin selector official g
Lrc;g:Lzx;
intermediary field_39230
Lnet/minecraft/class_2556;field_39230:Lnet/minecraft/class_5321;
named TEAM_MSG_COMMAND
Lnet/minecraft/network/MessageType;TEAM_MSG_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
EMOTE_COMMAND
- Mappings:
Namespace Name Mixin selector official h
Lrc;h:Lzx;
intermediary field_39231
Lnet/minecraft/class_2556;field_39231:Lnet/minecraft/class_5321;
named EMOTE_COMMAND
Lnet/minecraft/network/MessageType;EMOTE_COMMAND:Lnet/minecraft/util/registry/RegistryKey;
-
TELLRAW_COMMAND
- Mappings:
Namespace Name Mixin selector official i
Lrc;i:Lzx;
intermediary field_39232
Lnet/minecraft/class_2556;field_39232:Lnet/minecraft/class_5321;
named TELLRAW_COMMAND
Lnet/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 a
Lrc;a(Ljava/lang/String;)Lzx;
intermediary method_43845
Lnet/minecraft/class_2556;method_43845(Ljava/lang/String;)Lnet/minecraft/class_5321;
named getKey
Lnet/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 a
Lrc;a(Lhi;)Lrc;
intermediary method_43844
Lnet/minecraft/class_2556;method_43844(Lnet/minecraft/class_2378;)Lnet/minecraft/class_2556;
named registerAndGetDefault
Lnet/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 thechat
record component.- Returns:
- the value of the
chat
record component
-
overlay
Returns the value of theoverlay
record component.- Returns:
- the value of the
overlay
record component
-
narration
Returns the value of thenarration
record component.- Returns:
- the value of the
narration
record component
-