41 public const LEFT_CLICK_BLOCK = 0;
42 public const RIGHT_CLICK_BLOCK = 1;
46 protected bool $useItem =
true;
47 protected bool $useBlock =
true;
49 public function __construct(
52 protected Block $blockTouched,
54 protected Facing $blockFace,
55 protected int $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK
57 $this->player = $player;
58 $this->touchVector = $touchVector ?? Vector3::zero();
61 public function getAction() :
int{
65 public function getItem() :
Item{
66 return clone $this->item;
69 public function getBlock() :
Block{
70 return $this->blockTouched;
73 public function getTouchVector() :
Vector3{
74 return $this->touchVector;
77 public function getFace() :
Facing{
78 return $this->blockFace;
91 public function setUseItem(
bool $useItem) : void{ $this->useItem = $useItem; }
97 public function useBlock() : bool{ return $this->useBlock; }
103 public function setUseBlock(
bool $useBlock) : void{ $this->useBlock = $useBlock; }