use pocketmine\network\mcpe\handler\SessionHandler; class BlockEntityDataPacket extends DataPacket implements ClientboundPacket, ServerboundPacket{ public const NETWORK_ID = ProtocolInfo::BLOCK_ENTITY_DATA_PACKET; /** @var int */ public $x; /** @var int */ public $y; /** @var int */ public $z; /** @var string */ public $namedtag; public static function create(int $x, int $y, int $z, string $nbt) : self{ $result = new self; [$result->x, $result->y, $result->z] = [$x, $y, $z]; $result->namedtag = $nbt; return $result; } protected function decodePayload() : void{ $this->getBlockPosition($this->x, $this->y, $this->z); $this->namedtag = $this->getRemaining(); } protected function encodePayload() : void{ $this->putBlockPosition($this->x, $this->y, $this->z); $this->put($this->namedtag); } public function handle(SessionHandler $handler) : bool{ return $handler->handleBlockEntityData($this); } }