13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
20 public const NETWORK_ID = ProtocolInfo::INTERACT_PACKET;
22 public const ACTION_LEAVE_VEHICLE = 3;
23 public const ACTION_MOUSEOVER = 4;
24 public const ACTION_OPEN_NPC = 5;
25 public const ACTION_OPEN_INVENTORY = 6;
28 public int $targetActorRuntimeId;
34 $this->action = $in->getByte();
37 if($this->action === self::ACTION_MOUSEOVER || $this->action === self::ACTION_LEAVE_VEHICLE){
46 $out->putByte($this->action);
47 $out->putActorRuntimeId($this->targetActorRuntimeId);
49 if($this->action === self::ACTION_MOUSEOVER || $this->action === self::ACTION_LEAVE_VEHICLE){
50 $out->putLFloat($this->x);
51 $out->putLFloat($this->y);
52 $out->putLFloat($this->z);
57 return $handler->handleInteract($this);
handle(PacketHandlerInterface $handler)
encodePayload(PacketSerializer $out)
decodePayload(PacketSerializer $in)