addClickHandler

fun addClickHandler(click: EffectiveAbstractInteract.Click, callback: InteractCallback, ifRightClickOpenContainer: Boolean = false, cooldownData: EffectiveAbstractInteract.CooldownData<EffectiveClickable.EventsCallOptions>? = null)

Registers a click handler for stacks of this custom item (matched by key). To instead handle a plain vanilla Material, register through EffectiveClickable.addClickHandler with a non-custom stack.

Parameters

click

which mouse button triggers the callback

callback

invoked on click; its EffectiveAbstractInteract.Result decides whether the underlying Bukkit event is cancelled

ifRightClickOpenContainer

allow the vanilla container to open on right-click instead of swallowing the interaction

cooldownData

optional per-player cooldown for the handler