So since there is this new version of minecraft where there is no Player Movement on any server anymore we had to make an own fix. Here is the solution: PHP: public function onDataPacketSend(DataPacketSendEvent $event) { if($event->getPacket() instanceof BatchPacket) { $pk = $event->getPacket(); $packets = []; foreach($pk->getPackets() as $buf) { $pk1 = PacketPool::getPacket($buf); $pk1->buffer = $buf; $pk1->decode(); if($pk1 instanceof MoveActorAbsolutePacket) { $isHuman = false; foreach($this->getServer()->getLevels() as $level) { $entity = $level->getEntity($pk1->entityRuntimeId); if($entity instanceof Human) { if($entity->getId() == $event->getPlayer()->getId()) return; $isHuman = true; $pk2 = new MovePlayerPacket(); $pk2->entityRuntimeId = $pk1->entityRuntimeId; $pk2->position = $pk1->position; $pk2->pitch = $pk1->xRot; $pk2->headYaw = $pk1->yRot; $pk2->yaw = $pk1->zRot; $event->getPlayer()->dataPacket($pk2); $event->setCancelled(true); } } if(!$isHuman) { $packets[] = $pk1; } } else { $packets[] = $pk1; } } if(!empty($packets) && $event->isCancelled()) { $this->getServer()->batchPackets([$event->getPlayer()], $packets); } }} The problem is that when a player is near to many entitys the server crashes with the error: "Too many packets in a single batch" Is there any limit of packets to send or is there any issue in the code?
$p->sendPosition($p,$p->yaw,$p->pitch,MovePlayerPacket::MODE_NORMAL,$p->getViewers()); You dont need all that complicated code put this in your PlayerMoveEvent