use pocketmine\network\mcpe\NetworkSession; class ContainerOpenPacket extends DataPacket{ const NETWORK_ID = ProtocolInfo::CONTAINER_OPEN_PACKET; public $windowid; public $type; public $x; public $y; public $z; public $entityUniqueId = -1; public function decode(){ $this->windowid = $this->getByte(); $this->type = $this->getByte(); $this->getBlockPosition($this->x, $this->y, $this->z); $this->entityUniqueId = $this->getEntityUniqueId(); } public function encode(){ $this->reset(); $this->putByte($this->windowid); $this->putByte($this->type); $this->putBlockPosition($this->x, $this->y, $this->z); $this->putEntityUniqueId($this->entityUniqueId); } public function handle(NetworkSession $session) : bool{ return $session->handleContainerOpen($this); } }