Experimental

An early preview: docs, the API and the dashboard may change or break.

Report a problem

types.BlockUseEvent

A player right-clicking a block of a custom type. spend takes items from the slot the click came from, if that slot still holds the stack; it returns false otherwise, or with an empty hand.

Fields

blockUseEvent.block: types.Block
#
read only

The clicked block.

blockUseEvent.face: types.Face
#
read only

The face that was clicked.

blockUseEvent.hand: types.Hand
#
read only

The hand that clicked.

blockUseEvent.item: types.ItemStack?
#
read only

The stack in the clicking hand, or nil when it was empty.

blockUseEvent.player: types.Player
#
read only

Who clicked.

blockUseEvent.position: vector
#
read only

The clicked block's position.

Methods

blockUseEvent:spend(count: number?) -> boolean
#

Takes count items, one if nil, from the slot the click came from; returns whether it could.

Range: count: 1..99