slot %slot:INT% click [in|of] %inv:EXPR% — Blocks

slot %slot:INT% click [in|of] %inv:EXPR%
Inventory1.0.0

Description

Handles a click on a specific slot in a Lumen inventory. The event is automatically cancelled. Provides player, inventory, slot, item, cursor, clickType, action, and title variables.

Allowed Contexts

Root LevelInside Block

Block Variables

player
player
NullableNo

The player who clicked

world
world
NullableNo

The world the player is in

inventory
inventory
NullableNo

The top inventory being interacted with

slot
int
NullableNo

The raw slot index that was clicked

clickType
string
NullableNo

The type of click performed (e.g. LEFT, RIGHT, SHIFT_LEFT)

action
string
NullableNo

The inventory action triggered by the click

title
string
NullableNo

The title of the inventory view

item
itemstack
NullableYes

The item in the clicked slot, or null if empty

cursor
itemstack
NullableYes

The item on the cursor, or null if empty or air

Examples

slot 11 click in "main_menu": message player "You clicked the info button!"

All Possible Usages (3)

Every distinct way you can write this pattern, with optional groups and choice groups expanded. Placeholders are shown as <name>.

slot <slot> click <inv>
slot <slot> click in <inv>
slot <slot> click of <inv>

Related (Inventory)