1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

Loading Screen

Discussion in 'Plugin Help' started by IvanCraft623, Mar 8, 2021.

  1. IvanCraft623

    IvanCraft623 Baby Zombie

    Messages:
    105
    GitHub:
    IvanCraft623
    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.
     
  2. WEATHERCRAFTYT1

    WEATHERCRAFTYT1 Baby Zombie

    Messages:
    121
    Yes there is a way
     
  3. IvanCraft623

    IvanCraft623 Baby Zombie

    Messages:
    105
    GitHub:
    IvanCraft623
    But How?...
     
  4. WEATHERCRAFTYT1

    WEATHERCRAFTYT1 Baby Zombie

    Messages:
    121
  5. IvanCraft623

    IvanCraft623 Baby Zombie

    Messages:
    105
    GitHub:
    IvanCraft623
  6. IvanCraft623

    IvanCraft623 Baby Zombie

    Messages:
    105
    GitHub:
    IvanCraft623
    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 :/
     
  7. IvanCraft623

    IvanCraft623 Baby Zombie

    Messages:
    105
    GitHub:
    IvanCraft623
    The code:
    PHP:
    PluginUtils::sendChangeDimension($player0$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:
    <?php

    declare(strict_types=1);

    namespace 
    IvanCraft623\RunFromTheBeast\Tasks;

    use 
    IvanCraft623\RunFromTheBeast\{RunFromTheBeast as RFTB};

    use 
    pocketmine\{Playerscheduler\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());
        }
    }
     
  8. WEATHERCRAFTYT1

    WEATHERCRAFTYT1 Baby Zombie

    Messages:
    121
    So once they finished the screen loading tehy cant move?
     
  9. IvanCraft623

    IvanCraft623 Baby Zombie

    Messages:
    105
    GitHub:
    IvanCraft623
    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.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.