use pocketmine\math\Vector3; use pocketmine\network\mcpe\handler\PacketHandler; class SpawnExperienceOrbPacket extends DataPacket implements ServerboundPacket{ public const NETWORK_ID = ProtocolInfo::SPAWN_EXPERIENCE_ORB_PACKET; /** @var Vector3 */ public $position; /** @var int */ public $amount; protected function decodePayload() : void{ $this->position = $this->buf->getVector3(); $this->amount = $this->buf->getVarInt(); } protected function encodePayload() : void{ $this->buf->putVector3($this->position); $this->buf->putVarInt($this->amount); } public function handle(PacketHandler $handler) : bool{ return $handler->handleSpawnExperienceOrb($this); } }