Package-level declarations

Types

Link copied to clipboard
class PacketHandler : ChannelDuplexHandler

The packet channel handler that is responsible for firing packet events and intercepting packets. Use injectIncoming or injectOutgoing to inject packets into the netty pipeline starting at this handler.

Properties

Link copied to clipboard

The Player that sent the packet that is currently being handled, or null if no packet is being handled at the moment or if there is no player associated with it.

Link copied to clipboard

Whether the current thread is currently encoding packet data.

Link copied to clipboard
val ServerPlayer.packetHandler: PacketHandler?

Gets the PacketHandler for this player, or null if no handler is bound to the player. The handler can be assumed to be non-null after the player has finished joining the server.

Functions

Link copied to clipboard
fun installPacketHandler(plugin: JavaPlugin)

Installs the packet handler in the default channel pipeline. This sets up the packet event system and must be called on plugin enable, before any players have joined the server. (Nova addons do not need to call this)

Link copied to clipboard
fun RegistryFriendlyByteBuf(): RegistryFriendlyByteBuf

Creates a new empty RegistryFriendlyByteBuf using the default RegistryAccess.

Link copied to clipboard
fun Player.send(packets: Iterable<Packet<*>>)
fun Player.send(vararg packets: Packet<*>)

fun Player.send(vararg bufs: FriendlyByteBuf, retain: Boolean = true, flush: Boolean = true)

Sends raw byte bufs that represent encoded clientbound packets to this player, which are optionally retained based on retain, and optionally immediately flushed based on flush.

Link copied to clipboard
fun Packet<*>.sendTo(players: Iterable<Player>)
fun Packet<*>.sendTo(vararg players: Player)