addClickHandler

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

Registers a click handler for stacks matching item: by namespaced key if item is a custom item, otherwise by item's org.bukkit.Material (so pass a plain vanilla stack to match all stacks of that material).

Parameters

click

which button triggers callback

ifRightClickOpenContainer

only relevant for Click.RIGHT on a container block (chest, barrel, …): when false (default) the handler runs and the container stays closed; when true the handler is skipped and the container opens as usual

cooldownData

optional per-player cooldown gating the callback; while on cooldown the callback is not invoked