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

Change Dimension

Discussion in 'Development' started by #A6543, Feb 22, 2017.

  1. #A6543

    #A6543 Zombie

    Messages:
    267
    If I change the dimension of a player onPreLogin, the player ant move. The change of the dimension works.
    PHP:
    $pk = new ChangeDimensionPacket();
    $pk->dimension $dimension;
    $player->dataPacket($pk);
     
  2. corytortoise

    corytortoise Skeleton

    Messages:
    825
    GitHub:
    corytortoise
    What is $dimension?
     
  3. #A6543

    #A6543 Zombie

    Messages:
    267
    The dimension id. But I already said, that the dimension change works.
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    I've encountered more issues on PreLoginEvent. I had to create a workaround with EssentialsPE too, because changing the name of a player with nicks in PlayerPreLoginEvent resulted in the player getting disconnected from the server. Could you try reproducing this with something like PlayerJoinEvent?
     
  5. #A6543

    #A6543 Zombie

    Messages:
    267
    onJoin the loading screen doesn't stop

    *And in PlayerLogin event the player also can't move
     
    Last edited: Feb 22, 2017
  6. Muqsit

    Muqsit Chicken

    Messages:
    1,548
    GitHub:
    muqsit
    The player doesn't inherit the full Player class during pre login event ($event->getPlayer() might still be just a \pocketmine\entity\Human). Why not use PlayerLoginEvent with a delay, or PlayerJoinEvent?
     
    Last edited: Feb 22, 2017
  7. kaliiks

    kaliiks Zombie

    Messages:
    250
    I have same problem loading screen doesnt stop for me too
     
  8. #A6543

    #A6543 Zombie

    Messages:
    267
    I already said something to PlayerJoin and PlayerLogin... And I found something new. If I join the server normally, it works. It if I transfer to the server, I can't move
     
  9. Skullex

    Skullex Spider

    Messages:
    13
    GitHub:
    skull3x
    Just send them to the actual dimension nether (world) and then to the target level. The simple way! The only con that I noticed was that the sky in normal (target) dimensions becomes red like the nether.
     
  10. #A6543

    #A6543 Zombie

    Messages:
    267
    No wtf
     
  11. Skullex

    Skullex Spider

    Messages:
    13
    GitHub:
    skull3x
    ^
     
    Muqsit likes this.
  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.