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

$player->teleport(Position ... not work ...

Comments in 'Plugin Development' started by Ritch, Mar 10, 2016.

  1. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    PHP:
      if(count($this->players) >= 1){
                                    foreach(
    $this->players as $pl){
                                    
    $pl->sendMessage(TextFormat::GOLD."[GAME] ".$pl->getName()." joined GAME !.");
                                    
    $this->getServer()->loadLevel("test");
                                    
    $pl->teleport(new Position(137,156,-32$this->getServer()->getLevelByName("test")));
    //the position not work ..... For teleport player in level its work why ???
  2. PmServer
    Offline

    PmServer New Member

    Joined:
    May 7, 2015
    Posts:
    53
    Minecraft User:
    PmServer
  3. Vaivez66
    Offline

    Vaivez66 Notable Member Plugin Developer

    Joined:
    Jun 10, 2015
    Posts:
    402
    Plugins:
    2
    Please, don't spam if you ain't gonna help him at all...
    Skullex likes this.
  4. Hotshot_9930
    Offline

    Hotshot_9930 Notable Member Plugin Developer

    Joined:
    May 26, 2014
    Posts:
    665
    Plugins:
    2
    Minecraft User:
    HotshotHD
    How does it not work? Show the error messages if any.
  5. Ritch
    Offline

    Ritch Active Member

    Joined:
    Oct 4, 2015
    Posts:
    184
    Minecraft User:
    anonymous
    I not have message ....
  6. XxD7omGamer
    Offline

    XxD7omGamer New Member

    Joined:
    Jun 28, 2015
    Posts:
    38
    Minecraft User:
    XxD7omGamer
    PHP:
    Public function onEnable(){
    $this->getServer()->loadLevel("test");
    }
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    So by "Not work", explain more, at least say "nothing happened". "Not work" can have many meanings, including crashing, getting your player teleported to Herobrine, getting @shoghicp join your server, or getting sharks swimming on your server. (I know, I'm just listing events that are less and less likely to happen)

    And did your player move at all? And did any other messages on the client, on console, and did you set debug.level to 2?
    Ritch and CaptainKenji17 like this.
  8. CaptainKenji17
    Offline

    CaptainKenji17 Active Member

    Joined:
    Apr 22, 2014
    Posts:
    252
    Minecraft User:
    CaptainKenji17
    He means the player teleports on the current world spawn, try teleporting player first to world and next teleport to position? I dont know
  9. Nawaf_Craft1b
    Offline

    Nawaf_Craft1b Active Member Plugin Developer

    Joined:
    May 8, 2015
    Posts:
    232
    Plugins:
    1
    Minecraft User:
    Nawaf_Craft1b
    You Have To Load A Level

Share This Page

Advertisement