packetAnimation

fun Player.packetAnimation(plugin: Plugin, duration: Int, action: (Int) -> Unit)

Runs a tick-based animation loop for this player for duration ticks, calling action with the current tick index on each tick.

Parameters

plugin

The owning plugin.

duration

The total number of ticks to run.

action

Called each tick with the current tick index (0-based).