Class ChatMessageC2SPacket
java.lang.Object
net.minecraft.network.packet.c2s.play.ChatMessageC2SPacket
- All Implemented Interfaces:
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.
Messages that took more than TIME_TO_LIVE
to reach the server
are considered expired and will be discarded. Messages can also be discarded
if the server receives them with improper order.
- See Also:
- Mappings:
Namespace Name official xb
intermediary net/minecraft/class_2797
named net/minecraft/network/packet/c2s/play/ChatMessageC2SPacket
-
Field Summary
Modifier and TypeFieldDescriptionprivate final String
private final boolean
private final NetworkEncryptionUtils.SignatureData
static final Duration
private final Instant
-
Constructor Summary
ConstructorDescriptionChatMessageC2SPacket
(String chatMessage, ChatMessageSignature signature, boolean previewed) -
Method Summary
Modifier and TypeMethodDescriptionvoid
apply
(ServerPlayPacketListener serverPlayPacketListener) createSignatureInstance
(UUID sender) boolean
Returns whether the chat message was previewed before sending.void
write
(PacketByteBuf buf) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.network.Packet
isWritingErrorSkippable
-
Field Details
-
TIME_TO_LIVE
- Mappings:
Namespace Name Mixin selector official a
Lxb;a:Ljava/time/Duration;
intermediary field_39086
Lnet/minecraft/class_2797;field_39086:Ljava/time/Duration;
named TIME_TO_LIVE
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;TIME_TO_LIVE:Ljava/time/Duration;
-
chatMessage
- Mappings:
Namespace Name Mixin selector official b
Lxb;b: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;
-
timestamp
- Mappings:
Namespace Name Mixin selector official c
Lxb;c:Ljava/time/Instant;
intermediary field_39087
Lnet/minecraft/class_2797;field_39087:Ljava/time/Instant;
named timestamp
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;timestamp:Ljava/time/Instant;
-
signature
- Mappings:
Namespace Name Mixin selector official d
Lxb;d:Lakq$b;
intermediary field_39088
Lnet/minecraft/class_2797;field_39088:Lnet/minecraft/class_3515$class_7425;
named signature
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;signature:Lnet/minecraft/network/encryption/NetworkEncryptionUtils$SignatureData;
-
previewed
private final boolean previewed- Mappings:
Namespace Name Mixin selector official e
Lxb;e:Z
intermediary field_39390
Lnet/minecraft/class_2797;field_39390:Z
named previewed
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;previewed:Z
-
-
Constructor Details
-
ChatMessageC2SPacket
- Mappings:
Namespace Name Mixin selector official <init>
Lxb;<init>(Ljava/lang/String;Lrr;Z)V
intermediary <init>
Lnet/minecraft/class_2797;<init>(Ljava/lang/String;Lnet/minecraft/class_7469;Z)V
named <init>
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;<init>(Ljava/lang/String;Lnet/minecraft/network/encryption/ChatMessageSignature;Z)V
-
ChatMessageC2SPacket
- Mappings:
Namespace Name Mixin selector official <init>
Lxb;<init>(Lqx;)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
-
write
- Specified by:
write
in interfacePacket<ServerPlayPacketListener>
- Mappings:
Namespace Name Mixin selector official a
Lso;a(Lqx;)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
- Specified by:
apply
in interfacePacket<ServerPlayPacketListener>
- Mappings:
Namespace Name Mixin selector official a
Lxb;a(Lwv;)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
-
getChatMessage
- Mappings:
Namespace Name Mixin selector official b
Lxb;b()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;
-
createSignatureInstance
- Mappings:
Namespace Name Mixin selector official a
Lxb;a(Ljava/util/UUID;)Lrr;
intermediary method_43899
Lnet/minecraft/class_2797;method_43899(Ljava/util/UUID;)Lnet/minecraft/class_7469;
named createSignatureInstance
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;createSignatureInstance(Ljava/util/UUID;)Lnet/minecraft/network/encryption/ChatMessageSignature;
-
getTimestamp
- Mappings:
Namespace Name Mixin selector official c
Lxb;c()Ljava/time/Instant;
intermediary method_44315
Lnet/minecraft/class_2797;method_44315()Ljava/time/Instant;
named getTimestamp
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;getTimestamp()Ljava/time/Instant;
-
isPreviewed
public boolean isPreviewed()Returns whether the chat message was previewed before sending.- Returns:
- whether the chat message was previewed before sending
- API Note:
- Chat decorators can produce signed decorated content only if it was previewed.
- Mappings:
Namespace Name Mixin selector official d
Lxb;d()Z
intermediary method_44136
Lnet/minecraft/class_2797;method_44136()Z
named isPreviewed
Lnet/minecraft/network/packet/c2s/play/ChatMessageC2SPacket;isPreviewed()Z
-