Class ChatMessageC2SPacket

java.lang.Object
net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket
All Implemented Interfaces:
Packet<ServerPlayPacketListener>

public class ChatMessageC2SPacket extends Object implements Packet<ServerPlayPacketListener>
A packet used to send a chat message to the server.

This truncates the message to at most 256 characters before sending to the server on the client. If the server receives the message longer than 256 characters, it will reject the message and disconnect the client.

If the message contains an invalid character (see isValidChar), the server will reject the message and disconnect the client.

See Also:
Mappings:
Namespace Name
official wh
intermediary net/minecraft/class_2797
named net/minecraft/network/packet/c2s/play/ChatMessageC2SPacket
  • Field Details

    • MAX_LENGTH

      private static final int MAX_LENGTH
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lwh;b:I
      intermediary field_33359 Lnet/minecraft/class_2797;field_33359:I
      named MAX_LENGTH Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;MAX_LENGTH:I
    • field_39086

      public static final Duration field_39086
      Mappings:
      Namespace Name Mixin selector
      official a Lwh;a:Ljava/time/Duration;
      intermediary field_39086 Lnet/minecraft/class_2797;field_39086:Ljava/time/Duration;
      named field_39086 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;field_39086:Ljava/time/Duration;
    • field_39087

      private final Instant field_39087
      Mappings:
      Namespace Name Mixin selector
      official c Lwh;c:Ljava/time/Instant;
      intermediary field_39087 Lnet/minecraft/class_2797;field_39087:Ljava/time/Instant;
      named field_39087 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;field_39087:Ljava/time/Instant;
    • chatMessage

      private final String chatMessage
      Mappings:
      Namespace Name Mixin selector
      official d Lwh;d:Ljava/lang/String;
      intermediary field_12764 Lnet/minecraft/class_2797;field_12764:Ljava/lang/String;
      named chatMessage Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;chatMessage:Ljava/lang/String;
    • field_39088

      private final NetworkEncryptionUtils.class_7425 field_39088
      Mappings:
      Namespace Name Mixin selector
      official e Lwh;e:Lajp$b;
      intermediary field_39088 Lnet/minecraft/class_2797;field_39088:Lnet/minecraft/class_3515$class_7425;
      named field_39088 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;field_39088:Lnet/minecraft/network/encryption/NetworkEncryptionUtils$class_7425;
  • Constructor Details

    • ChatMessageC2SPacket

      public ChatMessageC2SPacket(Instant instant, String chatMessage, NetworkEncryptionUtils.class_7425 class_7425)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lwh;<init>(Ljava/time/Instant;Ljava/lang/String;Lajp$b;)V
      intermediary <init> Lnet/minecraft/class_2797;<init>(Ljava/time/Instant;Ljava/lang/String;Lnet/minecraft/class_3515$class_7425;)V
      named <init> Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;<init>(Ljava/time/Instant;Ljava/lang/String;Lnet/minecraft/network/encryption/NetworkEncryptionUtils$class_7425;)V
    • ChatMessageC2SPacket

      public ChatMessageC2SPacket(PacketByteBuf buf)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lwh;<init>(Lqn;)V
      intermediary <init> Lnet/minecraft/class_2797;<init>(Lnet/minecraft/class_2540;)V
      named <init> Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;<init>(Lnet/minecraft/network/PacketByteBuf;)V
  • Method Details

    • method_43632

      private static String method_43632(String string)
      Mappings:
      Namespace Name Mixin selector
      official a Lwh;a(Ljava/lang/String;)Ljava/lang/String;
      intermediary method_43632 Lnet/minecraft/class_2797;method_43632(Ljava/lang/String;)Ljava/lang/String;
      named method_43632 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;method_43632(Ljava/lang/String;)Ljava/lang/String;
    • write

      public void write(PacketByteBuf buf)
      Specified by:
      write in interface Packet<ServerPlayPacketListener>
      Mappings:
      Namespace Name Mixin selector
      official a Lry;a(Lqn;)V
      intermediary method_11052 Lnet/minecraft/class_2596;method_11052(Lnet/minecraft/class_2540;)V
      named write Lnet/minecraft/network/Packet;write(Lnet/minecraft/network/PacketByteBuf;)V
    • apply

      public void apply(ServerPlayPacketListener serverPlayPacketListener)
      Specified by:
      apply in interface Packet<ServerPlayPacketListener>
      Mappings:
      Namespace Name Mixin selector
      official a Lwh;a(Lwc;)V
      intermediary method_12115 Lnet/minecraft/class_2797;method_12115(Lnet/minecraft/class_2792;)V
      named apply Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;apply(Lnet/minecraft/network/listener/ServerPlayPacketListener;)V
    • method_43634

      public Instant method_43634()
      Mappings:
      Namespace Name Mixin selector
      official b Lwh;b()Ljava/time/Instant;
      intermediary method_43634 Lnet/minecraft/class_2797;method_43634()Ljava/time/Instant;
      named method_43634 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;method_43634()Ljava/time/Instant;
    • getChatMessage

      public String getChatMessage()
      Mappings:
      Namespace Name Mixin selector
      official c Lwh;c()Ljava/lang/String;
      intermediary method_12114 Lnet/minecraft/class_2797;method_12114()Ljava/lang/String;
      named getChatMessage Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;getChatMessage()Ljava/lang/String;
    • method_43635

      public String method_43635()
      Mappings:
      Namespace Name Mixin selector
      official d Lwh;d()Ljava/lang/String;
      intermediary method_43635 Lnet/minecraft/class_2797;method_43635()Ljava/lang/String;
      named method_43635 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;method_43635()Ljava/lang/String;
    • method_43636

      public NetworkEncryptionUtils.class_7425 method_43636()
      Mappings:
      Namespace Name Mixin selector
      official e Lwh;e()Lajp$b;
      intermediary method_43636 Lnet/minecraft/class_2797;method_43636()Lnet/minecraft/class_3515$class_7425;
      named method_43636 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;method_43636()Lnet/minecraft/network/encryption/NetworkEncryptionUtils$class_7425;
    • method_43637

      private Instant method_43637()
      Mappings:
      Namespace Name Mixin selector
      official f Lwh;f()Ljava/time/Instant;
      intermediary method_43637 Lnet/minecraft/class_2797;method_43637()Ljava/time/Instant;
      named method_43637 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;method_43637()Ljava/time/Instant;
    • method_43633

      public boolean method_43633(Instant instant)
      Mappings:
      Namespace Name Mixin selector
      official a Lwh;a(Ljava/time/Instant;)Z
      intermediary method_43633 Lnet/minecraft/class_2797;method_43633(Ljava/time/Instant;)Z
      named method_43633 Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;method_43633(Ljava/time/Instant;)Z