onRightClick

open override fun onRightClick(action: RegisteredKItem.(Player, PlayerInteractEvent) -> Unit)

Executed when the player right-clicked with this item outside an inventory

The code block will receive a PlayerInteractEvent which is validated to have a valid item and a valid click.

Keep in mind, this function only works in the same runtime as the item was generated. If the server is restarted, this will not trigger on the item. To still trigger the action, please use the addBehavior function.

Parameters

action

code block which is executed