VfxBuilder

class VfxBuilder(player: Player)

DSL builder for sending packet-based visual and audio effects to a Player.

Obtain an instance via the Player.vfx extension function.

Parameters

player

The target player for all operations in this builder.

Constructors

Link copied to clipboard
constructor(player: Player)

Functions

Link copied to clipboard
fun blockCrack(location: Location, stage: Int)

Sends a block crack (mining progress) animation to the player.

Link copied to clipboard
fun explosion(location: Location, power: Float = 1.0f)

Sends a fake explosion effect to the player at the given location.

Link copied to clipboard
fun fakeEquipment(entityId: Int, slot: EquipmentSlot, item: ItemStack)

Sends a fake equipment packet to the player for the specified entity slot.

Link copied to clipboard
fun lightning(location: Location)

Sends a fake lightning strike effect to the player at the given location.

Link copied to clipboard
fun localSound(sound: Sound, location: Location, volume: Float = 1.0f, pitch: Float = 1.0f)

Plays a sound at a specific location for the player only.

Link copied to clipboard
fun onFire(entityId: Int, onFire: Boolean = true)

Sets the on-fire visual state of an entity for the player.