It's easy to send a client the ChangeDimensionPacket, but how do you unsend it? I mean, how do you remove the loading screen shown during ChangeDimensionPacket after sending the packet? The client is basically stuck on the loading screen once you've sent the packet to them.
But it never does, for some reason. I've tried to teleport the player: 100 blocks away from the initial position. Same position. None of them worked. I thought it might be a network problem, but I have no problem in loading chunks. I've restarted by system, yet the issue still exists.
You need to send a PlayStatusPacket to spawn the player, the same as how the initial spawn sequence is completed.
You cannot change a player's dimension to a dimension they are already in. The game isn't designed for this, it will cause bugs. You need to send them to a different dimension, then back to the target.
Look it i changed player dimension to nether then back to overworld and look what is it doing Spoiler Here is code PHP: $pk2 = new ChangeDimensionPacket();$pk2->dimension = 1;$pk2->x = $p->getX();$pk2->x = $p->getY();$pk2->x = $p->getZ();$p->dataPacket($pk2);$pk2 = new ChangeDimensionPacket();$pk2->dimension = 0;$pk2->x = $p->getX();$pk2->x = $p->getY() ;$pk2->x = $p->getZ();$p->dataPacket($pk2);$pk = new PlayStatusPacket();$pk->status = 3;$p->dataPacket($pk);
change PHP: $pk2->x = $p->getX();$pk2->x = $p->getY();$pk2->x = $p->getZ(); to PHP: $pk2->x = $p->getX();$pk2->y = $p->getY();$pk2->z = $p->getZ(); And i think you need to delay between packets
wait a sec, hold on i may be misunderstanding but you are suppose to not use while loops as a alternative to sleep(), it will block the main thread too