Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Send Loading screen to player

Comments in 'Plugin Development' started by Flabe, Oct 16, 2016.

  1. Flabe
    Offline

    Flabe Active Member

    Joined:
    Nov 17, 2015
    Posts:
    147
    Minecraft User:
    Flabe231
    Hey guys, I want to send ChangeDimensionPacket , but i want to do it fast and i want to change dimension to normal (0) again, can you help me to do it? If not, are there any ways to send loading screen to player for 2 - 3 sec. ?
  2. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    PHP:
    $time 3;
    $time--;
    $pk = new StartGamePacket();
    $pk->seed = -1;
    $pk->dimension $player->getLevel()->getDimension();
    $pk->$player->x;
    $pk->$player->y;
    $pk->$player->z;
    $pk->generator 1//0 old, 1 infinite, 2 flat
    $pk->gamemode $player->gamemode 0x01;
    $pk->eid 0;
    $player->dataPacket($pk);
    if(
    $time == 0){
    unset(
    $pk);
    unset(
    $time);
    }
    Maybe this would work, never tried
    Last edited: Oct 19, 2016
  3. dktapps
    Offline

    dktapps Active Member

    Joined:
    Jul 25, 2016
    Posts:
    101
    It can be done, and has been attempted several times by various developers. The problem is that frequently one of the packets ends up lost and then the sky colour of the destination ends up incorrect.
  4. Dog2puppy
    Offline

    Dog2puppy New Member

    Joined:
    Nov 30, 2015
    Posts:
    28
    Minecraft User:
    Dog2puppy
    Will this send the player to a new, freshly generator world? And would it keep them in the same gamemode?
  5. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    I have done this and it works but I did notice that using the dimension of the players level can crash the player, I would suggest generating a new level and teleporting them there so you can send a fresh packet then teleporting them back.
    Skullex likes this.
  6. Dog2puppy
    Offline

    Dog2puppy New Member

    Joined:
    Nov 30, 2015
    Posts:
    28
    Minecraft User:
    Dog2puppy
    Can you please explain more in detail?
  7. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    Sure, I'm not going to give exact code (don't feel like digging through my core) but what I did is generated an empty world (no blocks or anything) then sent the player a ChangeDimensionPacket with the dimension set as Nether. After I sent that packet I teleported them to the empty world and then transferred them to another server (if thats what you want to do) then when a player joins I teleport them back to the default world and send them a Normal ChangeDimensionPacket.
    Skullex likes this.
  8. Dog2puppy
    Offline

    Dog2puppy New Member

    Joined:
    Nov 30, 2015
    Posts:
    28
    Minecraft User:
    Dog2puppy
    Very confusing. I need to send the packet, without them noticing a world change or changing servers.
  9. ImagicalGamer
    Offline

    ImagicalGamer Active Member

    Joined:
    Feb 25, 2016
    Posts:
    141
    Minecraft User:
    ImagicalGamer
    They shouldn't notice it if you send the packet then immediately change servers/levels.
  10. Skullex
    Offline

    Skullex Active Member

    Joined:
    Nov 14, 2015
    Posts:
    212
    Minecraft User:
    Skullex
    I'll try your methods, thanks!

Share This Page

Advertisement