use pocketmine\network\mcpe\handler\PacketHandler; class TakeItemActorPacket extends DataPacket implements ClientboundPacket{ public const NETWORK_ID = ProtocolInfo::TAKE_ITEM_ACTOR_PACKET; /** @var int */ public $target; /** @var int */ public $eid; public static function create(int $takerEntityRuntimeId, int $itemEntityRuntimeId) : self{ $result = new self; $result->target = $itemEntityRuntimeId; $result->eid = $takerEntityRuntimeId; return $result; } protected function decodePayload() : void{ $this->target = $this->getEntityRuntimeId(); $this->eid = $this->getEntityRuntimeId(); } protected function encodePayload() : void{ $this->putEntityRuntimeId($this->target); $this->putEntityRuntimeId($this->eid); } public function handle(PacketHandler $handler) : bool{ return $handler->handleTakeItemActor($this); } }