Documentation

PlayerInteractEvent extends PlayerEvent
in package
implements Cancellable Uses CancellableTrait

Called when a player interacts or touches a block (including air?)

Interfaces, Classes, Traits and Enums

Cancellable
This interface is implemented by an Event subclass if and only if it can be cancelled.

Table of Contents

LEFT_CLICK_BLOCK  = 0
RIGHT_CLICK_BLOCK  = 1
MAX_EVENT_CALL_DEPTH  = 50
$action  : int
$blockFace  : int
$blockTouched  : Block
$eventName  : string|null
$item  : Item
$player  : Player
$touchVector  : Vector3
$eventCallDepth  : int
$isCancelled  : bool
__construct()  : mixed
call()  : void
Calls event handlers registered for this event.
cancel()  : void
getAction()  : int
getBlock()  : Block
getEventName()  : string
getFace()  : int
getItem()  : Item
getPlayer()  : Player
getTouchVector()  : Vector3
isCancelled()  : bool
uncancel()  : void

Constants

MAX_EVENT_CALL_DEPTH

private mixed MAX_EVENT_CALL_DEPTH = 50

Properties

$eventName

protected string|null $eventName = null

$eventCallDepth

private static int $eventCallDepth = 1

Methods

__construct()

public __construct(Player $player, Item $item, Block $block, Vector3|null $touchVector, int $face[, int $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK ]) : mixed
Parameters
$player : Player
$item : Item
$block : Block
$touchVector : Vector3|null
$face : int
$action : int = PlayerInteractEvent::RIGHT_CLICK_BLOCK
Return values
mixed

call()

Calls event handlers registered for this event.

public call() : void
Tags
throws
RuntimeException

if event call recursion reaches the max depth limit

Return values
void

getEventName()

public final getEventName() : string
Return values
string

Search results