Hello! Is there a way to show a loading screen? for example I want to send you a loading screen when a player changes world.
Hmm check out here for an idea https://forums.pmmp.io/threads/send-loading-screen-when-doing-hub.53/page-2
I have developed a code that works .. or something like that. It has a problem the players at the end of the loading screen cannot move :/
The code: PHP: PluginUtils::sendChangeDimension($player, 0, $player->asVector3()); PHP: public static function sendChangeDimension(Player $player, $dimension, $position) { $pk = new ChangeDimensionPacket(); $pk->dimension = $dimension; $pk->position = $position; $pk->respawn = false; $player->dataPacket($pk); RFTB::getInstance()->getScheduler()->scheduleDelayedTask(new EndChangeDimension($player), 60); } PHP: <?phpdeclare(strict_types=1);namespace IvanCraft623\RunFromTheBeast\Tasks;use IvanCraft623\RunFromTheBeast\{RunFromTheBeast as RFTB};use pocketmine\{Player, scheduler\Task};use pocketmine\network\mcpe\protocol\{PlayStatusPacket};/** * Class EndChangeDimension */class EndChangeDimension extends Task { public $player; public function __construct(Player $player) { $this->player = $player; } public function onRun(int $currentTick) : void { $this->player->sendPlayStatus(PlayStatusPacket::PLAYER_SPAWN); RFTB::getInstance()->getScheduler()->cancelTask($this->getTaskId()); }}
Yep, I have realized that the reason is that I am trying to do it with 2 worlds of the same dimension, apparently it does not bug me if it uses the loading screen of another dimension but in this video() it uses the loading screen to overworld with the two worlds being overworld , so I know there is a way to do it with the overworld loading screen, but I don't know how.