Events
The "events" section of a block or item's YAML allows you to execute Minecraft commands when certain interactions are performed.
List of event names
onRightClick
:Function: Triggered when a block or item is right-clicked.
onLeftClick
:Function: Triggered when a block or item is left-clicked.
onRightClickAir
:Function: Triggered when an item is right-clicked while looking at air.
onLeftClickAir
:Function: Triggered when an item or block is left-clicked while looking at air.
onRightClickBlock
:Function: Triggered when the player is looking at a block and a right-click is performed.
onLeftClickBlock
:Function: Triggered when the player is looking at a block and a left-click is performed.
onPlaced
:Function: Triggered when a block is placed.
onBroken
:Function: Triggered when a block or item is broken.
onDamaged
:Function: Triggered when an item or block is damaged.
onPushed
:Function: Triggered when a block is pushed by a piston.
Last updated