Skip to content
3add edited this page Dec 16, 2025 · 11 revisions

Packets sent & received by the server can be listened to using packet events

Listening

Clientbound Packets

Clientbound packets are packets sent from the server to a connected client. You can listen to them using the following:

on packet interact entity packet receive netty processed:
    cancel packet

Serverbound Packets

Serverbound packets are packets that are sent from the client to the server. You can listen to them using the following:

on packet chunk data packet send netty processed:
    cancel packet

Processing

Packets can be processed on 3 different type of threads.

Netty Threads

Netty threads are the threads that process all sent or received packets. Unlike other threads, these threads allow you to cancel or modify the packets. This is because the packets would've otherwise been processed by the server and thus can't be canceled or modified. Long Netty processing will increase player ping.

Async Threads

Async threads are an asynchronous thread relative to the main server thread which Minecraft operates on. These are useful for heavy computations and won't impact the main thread.

The Sync Thread

The Sync thread is the main Minecraft thread. It's where the majority of Minecraft runs on. Long sync processing will lag the server.

Caution

Minecraft is mostly NOT thread safe and thus you can only access Minecraft related things if the packet is processed on the sync thread. It is not possible to check Minecraft things and then cancel or alter the packet.

Clone this wiki locally