pocketmine\event\player\PlayerInteractEvent::__construct PHP Method

__construct() public method

public __construct ( Player $player, Item $item, Vector3 $block, $face, $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK )
$player pocketmine\Player
$item pocketmine\item\Item
$block pocketmine\math\Vector3
    public function __construct(Player $player, Item $item, Vector3 $block, $face, $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK)
    {
        if ($block instanceof Block) {
            $this->blockTouched = $block;
            $this->touchVector = new Vector3(0, 0, 0);
        } else {
            $this->touchVector = $block;
            $this->blockTouched = Block::get(0, 0, new Position(0, 0, 0, $player->level));
        }
        $this->player = $player;
        $this->item = $item;
        $this->blockFace = (int) $face;
        $this->action = (int) $action;
    }