Wizards of Lua

The Art of Spell Crafting


PlayerInteractEvent

The PlayerInteractEvent is the base class of LeftClickBlockEvent and RightClickBlockEvent.

The PlayerInteractEvent class is a subtype of the Event class and inherits all its properties and functions.

Here is an overview of the PlayerInteractEvent properties:

Property Type read / write
face string r
hand string r
item Item r
player Player r
pos Vec3 r

Properties

Below you find short descriptions about each of the properties and some examples about how to use them in your spells.


face : string

The face of the block that was clicked at. Can be one of ‘up’, ‘down’, ‘north’, ‘east’, ‘south’, and ‘west’.


hand : string

The hand the player used to hit the block. Can be ‘MAIN_HAND’ or ‘OFF_HAND’.


item : Item

The item in the player’s hand.


player : Player

The player that triggered this event.


pos : Vec3

The block’s position.