Experimental

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

Report a problem

types.EntityClickEvent

A player right-clicking or hitting an entity. spend is as on UseEvent, for the hand that clicked; an attack always uses the main hand.

Fields

entityClickEvent.entity: types.Entity
#
read only

What was clicked.

entityClickEvent.hand: types.Hand
#
read only

The hand that clicked.

entityClickEvent.item: types.ItemStack?
#
read only

The stack in that hand, or nil for an empty hand.

entityClickEvent.player: types.Player
#
read only

Who clicked.

Methods

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

Takes count items, one if nil, from the hand that clicked; returns whether it could.

Range: count: 1..99