PocketMine-MP 5.33.2 git-919492bdcad8510eb6606439eb77e1c604f1d1ea
|
Public Member Functions | |
__construct (Player $player, protected Item $item, protected Block $blockTouched, ?Vector3 $touchVector, protected Facing $blockFace, protected int $action=PlayerInteractEvent::RIGHT_CLICK_BLOCK) | |
call () | |
getAction () | |
getBlock () | |
getEventName () | |
getFace () | |
getItem () | |
getPlayer () | |
getTouchVector () | |
isCancelled () | |
setUseBlock (bool $useBlock) | |
setUseItem (bool $useItem) | |
useBlock () | |
useItem () | |
Static Public Member Functions | |
static | hasHandlers () |
Public Attributes | |
const | LEFT_CLICK_BLOCK = 0 |
const | RIGHT_CLICK_BLOCK = 1 |
Protected Attributes | |
string | $eventName = null |
Player | $player |
Vector3 | $touchVector |
bool | $useBlock = true |
bool | $useItem = true |
Called when a player interacts or touches a block. This is called for both left click (start break) and right click (use).
Definition at line 38 of file PlayerInteractEvent.php.
pocketmine\event\player\PlayerInteractEvent::__construct | ( | Player | $player, |
protected Item | $item, | ||
protected Block | $blockTouched, | ||
?Vector3 | $touchVector, | ||
protected Facing | $blockFace, | ||
protected int | $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK ) |
Definition at line 49 of file PlayerInteractEvent.php.
|
inherited |
pocketmine\event\player\PlayerInteractEvent::getAction | ( | ) |
Definition at line 61 of file PlayerInteractEvent.php.
pocketmine\event\player\PlayerInteractEvent::getBlock | ( | ) |
Definition at line 69 of file PlayerInteractEvent.php.
pocketmine\event\player\PlayerInteractEvent::getFace | ( | ) |
Definition at line 77 of file PlayerInteractEvent.php.
pocketmine\event\player\PlayerInteractEvent::getItem | ( | ) |
Definition at line 65 of file PlayerInteractEvent.php.
|
inherited |
Definition at line 35 of file PlayerEvent.php.
pocketmine\event\player\PlayerInteractEvent::getTouchVector | ( | ) |
Definition at line 73 of file PlayerInteractEvent.php.
|
staticinherited |
|
inherited |
Returns whether this instance of the event is currently cancelled.
If it is cancelled, only downstream handlers that declare @handleCancelled
will be called with this event.
pocketmine\event\player\PlayerInteractEvent::setUseBlock | ( | bool | $useBlock | ) |
Sets whether the block may react to the interaction. If false, doors, fence gates and trapdoors will not respond, containers will not open, etc.
Definition at line 103 of file PlayerInteractEvent.php.
pocketmine\event\player\PlayerInteractEvent::setUseItem | ( | bool | $useItem | ) |
Sets whether the used item may react to the interaction. If false, items such as spawn eggs will not activate. This does NOT prevent blocks from being placed - it makes the item behave as if the player is sneaking.
Definition at line 91 of file PlayerInteractEvent.php.
pocketmine\event\player\PlayerInteractEvent::useBlock | ( | ) |
Returns whether the block may react to the interaction. If false, doors, fence gates and trapdoors will not respond, containers will not open, etc.
Definition at line 97 of file PlayerInteractEvent.php.
pocketmine\event\player\PlayerInteractEvent::useItem | ( | ) |
Returns whether the item may react to the interaction. If disabled, items such as spawn eggs will not activate. This does NOT prevent blocks from being placed - it makes the item behave as if the player is sneaking.
Definition at line 85 of file PlayerInteractEvent.php.
|
protectedinherited |
|
protectedinherited |
Definition at line 33 of file PlayerEvent.php.
|
protected |
Definition at line 44 of file PlayerInteractEvent.php.
|
protected |
Definition at line 47 of file PlayerInteractEvent.php.
|
protected |
Definition at line 46 of file PlayerInteractEvent.php.
const pocketmine\event\player\PlayerInteractEvent::LEFT_CLICK_BLOCK = 0 |
Definition at line 41 of file PlayerInteractEvent.php.
const pocketmine\event\player\PlayerInteractEvent::RIGHT_CLICK_BLOCK = 1 |
Definition at line 42 of file PlayerInteractEvent.php.