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
LEFT_CLICK_BLOCK
public
mixed
LEFT_CLICK_BLOCK
= 0
RIGHT_CLICK_BLOCK
public
mixed
RIGHT_CLICK_BLOCK
= 1
MAX_EVENT_CALL_DEPTH
private
mixed
MAX_EVENT_CALL_DEPTH
= 50
Properties
$action
protected
int
$action
$blockFace
protected
int
$blockFace
$blockTouched
protected
Block
$blockTouched
$eventName
protected
string|null
$eventName
= null
$item
protected
Item
$item
$player
protected
Player
$player
$touchVector
protected
Vector3
$touchVector
$eventCallDepth
private
static int
$eventCallDepth
= 1
$isCancelled
private
bool
$isCancelled
= false
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
Return values
void —cancel()
public
cancel() : void
Return values
void —getAction()
public
getAction() : int
Return values
int —getBlock()
public
getBlock() : Block
Return values
Block —getEventName()
public
final getEventName() : string
Return values
string —getFace()
public
getFace() : int
Return values
int —getItem()
public
getItem() : Item
Return values
Item —getPlayer()
public
getPlayer() : Player
Return values
Player —getTouchVector()
public
getTouchVector() : Vector3
Return values
Vector3 —isCancelled()
public
isCancelled() : bool
Return values
bool —uncancel()
public
uncancel() : void