Experimental

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

Report a problem

types.UseEvent

A player right-clicking with an item type, in the air or on a block. spend takes items from the slot the use came from, if that slot still holds the stack; it returns false otherwise.

Fields

useEvent.block: vector?
#
read only

The clicked block's position, or nil for a use in the air.

useEvent.face: types.Face?
#
read only

The clicked face, or nil for a use in the air.

useEvent.hand: types.Hand
#
read only

The hand it was used from.

useEvent.item: types.ItemStack
#
read only

The stack that was used.

useEvent.player: types.Player
#
read only

Who used the item.

Methods

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

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

Range: count: 1..99