Record Class MessageFormat

java.lang.Object
java.lang.Record
net.minecraft.network.MessageFormat
Record Components:
translationKey -
parameters -
style -

public record MessageFormat(String translationKey, List<MessageFormat.Parameter> parameters, Style style) extends Record
A message format applies on a server-sent message and its sender to stylize it.
Mappings:
Namespace Name
official ra
intermediary net/minecraft/class_7463
named net/minecraft/network/MessageFormat
official b
intermediary comp_788
named translationKey
official c
intermediary comp_789
named parameters
official d
intermediary comp_790
named style
  • Field Details

    • translationKey

      private final String translationKey
      The field for the translationKey record component.
    • parameters

      private final List<MessageFormat.Parameter> parameters
      The field for the parameters record component.
    • style

      private final Style style
      The field for the style record component.
    • CODEC

      public static final com.mojang.serialization.Codec<MessageFormat> CODEC
      The codec for chat format.
      Mappings:
      Namespace Name Mixin selector
      official a Lra;a:Lcom/mojang/serialization/Codec;
      intermediary field_39219 Lnet/minecraft/class_7463;field_39219:Lcom/mojang/serialization/Codec;
      named CODEC Lnet/minecraft/network/MessageFormat;CODEC:Lcom/mojang/serialization/Codec;
  • Constructor Details

  • Method Details

    • plain

      public static MessageFormat plain(String translationKey)
      Returns a message format that applies the translation key with the sender's name and the message content.
      Returns:
      a message format that applies the translation key with the sender's name and the message content
      Mappings:
      Namespace Name Mixin selector
      official a Lra;a(Ljava/lang/String;)Lra;
      intermediary method_43831 Lnet/minecraft/class_7463;method_43831(Ljava/lang/String;)Lnet/minecraft/class_7463;
      named plain Lnet/minecraft/network/MessageFormat;plain(Ljava/lang/String;)Lnet/minecraft/network/MessageFormat;
    • italicGray

      public static MessageFormat italicGray(String translationKey)
      Returns a message format that applies the translation key with the sender's name and the message content, and applies a gray, italic style.
      Returns:
      a message format that applies the translation key with the sender's name and the message content, and applies a gray, italic style
      Mappings:
      Namespace Name Mixin selector
      official b Lra;b(Ljava/lang/String;)Lra;
      intermediary method_43833 Lnet/minecraft/class_7463;method_43833(Ljava/lang/String;)Lnet/minecraft/class_7463;
      named italicGray Lnet/minecraft/network/MessageFormat;italicGray(Ljava/lang/String;)Lnet/minecraft/network/MessageFormat;
    • team

      public static MessageFormat team(String translationKey)
      Returns a message format that applies the translation key with the sender's team name, the sender's name, and the message content.
      Returns:
      a message format that applies the translation key with the sender's team name, the sender's name, and the message content
      Mappings:
      Namespace Name Mixin selector
      official c Lra;c(Ljava/lang/String;)Lra;
      intermediary method_43835 Lnet/minecraft/class_7463;method_43835(Ljava/lang/String;)Lnet/minecraft/class_7463;
      named team Lnet/minecraft/network/MessageFormat;team(Ljava/lang/String;)Lnet/minecraft/network/MessageFormat;
    • apply

      public Text apply(Text content, @Nullable @Nullable ChatMessageSender sender)
      Mappings:
      Namespace Name Mixin selector
      official a Lra;a(Lrf;Lrb;)Lrf;
      intermediary method_43832 Lnet/minecraft/class_7463;method_43832(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)Lnet/minecraft/class_2561;
      named apply Lnet/minecraft/network/MessageFormat;apply(Lnet/minecraft/text/Text;Lnet/minecraft/network/ChatMessageSender;)Lnet/minecraft/text/Text;
    • getArgs

      private Text[] getArgs(Text content, @Nullable @Nullable ChatMessageSender sender)
      Mappings:
      Namespace Name Mixin selector
      official b Lra;b(Lrf;Lrb;)[Lrf;
      intermediary method_43834 Lnet/minecraft/class_7463;method_43834(Lnet/minecraft/class_2561;Lnet/minecraft/class_7436;)[Lnet/minecraft/class_2561;
      named getArgs Lnet/minecraft/network/MessageFormat;getArgs(Lnet/minecraft/text/Text;Lnet/minecraft/network/ChatMessageSender;)[Lnet/minecraft/text/Text;
    • 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.
    • translationKey

      public String translationKey()
      Returns the value of the translationKey record component.
      Returns:
      the value of the translationKey record component
    • parameters

      public List<MessageFormat.Parameter> parameters()
      Returns the value of the parameters record component.
      Returns:
      the value of the parameters record component
    • style

      public Style style()
      Returns the value of the style record component.
      Returns:
      the value of the style record component