openGuiOnRightClickWithMeta

fun openGuiOnRightClickWithMeta(guiProvider: (Player, ItemStack) -> GuiBuilder): CustomItem

Opens a GUI when the item is right-clicked, passing the item as a parameter.

Parameters

guiProvider

A lambda function that takes a Player and an ItemStack, and returns a GuiBuilder. This function will be called when the item is right-clicked.