packet

@JvmName(name = "packetWithPlayer")
fun packet(player: Player, action: PacketBuilder.() -> Unit)

Entry point for the packet DSL. Applies action to a PacketBuilder for the given player.

Parameters

player

The target player.

action

DSL block for sending packet-based effects.


fun Player.packet(action: PacketBuilder.() -> Unit)

Extension function for Player that provides packet DSL access.

This is a convenience wrapper around the top-level packet function, allowing for more idiomatic usage when the player instance is already available.

Example:

player.packet {
title {
title = "Welcome"
subtitle = "to the server"
}
actionBar("Use /help for commands")
}

Parameters

action

DSL block for configuring packet-based effects to send to this player.

See also