0x03 S03PacketEnableCompression

Enables zlib compression for all subsequent packets. Sets the compression threshold — packets >= this size are compressed.

Clientbound (Server → Client) · LOGIN · net/minecraft/network//S03PacketEnableCompression.java
logincompression

Fields

FieldTypeDescription
compressionThresholdVarIntMinimum packet size in bytes before compression is applied. -1 disables compression.

Wire Encoding

FieldTypeNotes
ThresholdVarIntTypically 256 in vanilla; -1 = disabled

MCP References

MCPNetHandlerLoginClient.handleEnableCompression()

Handler Interface

HNDINetHandlerLoginClient

Notes

After this packet, all future packets start with a VarInt prefix indicating the uncompressed length. If length=0, the data is uncompressed (smaller than threshold). If length>0, the remaining data is zlib-compressed and must be inflated.

implementation Implementation Cases

Disabler

Cancel or delay compression to prevent server-side anti-cheat from reading packets.

Vanilla hook: EventReceivePacket
← Back to all packets