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

teleporting a player

Comments in 'Plugin Development' started by Sensej, May 29, 2015.

  1. Sensej
    Offline

    Sensej New Member

    Joined:
    Aug 5, 2014
    Posts:
    64
    Hey

    When im trying to teleport a Player in the PlayerJoinEevent the Player wont get Teleported.

    Code:

    PHP:
    public function onJoin(PlayerJoinEvent $event)
    {
          
    $event->getPlayer()->teleport(new Position($x$y$z$level));
    }
  2. Sensej
    Offline

    Sensej New Member

    Joined:
    Aug 5, 2014
    Posts:
    64
    The Variables are defined in my Code ;)
  3. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    Try PlayerRespawnEvent.
    tigerza118 and CraftYourBukkit like this.
  4. Sensej
    Offline

    Sensej New Member

    Joined:
    Aug 5, 2014
    Posts:
    64
    Is there a other methode?
  5. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    No
  6. Sensej
    Offline

    Sensej New Member

    Joined:
    Aug 5, 2014
    Posts:
    64
    Because respawn event doesent work...
  7. Asidert
    Offline

    Asidert Active Member Plugin Developer

    Joined:
    Oct 21, 2014
    Posts:
    123
    Plugins:
    1
    Minecraft User:
    Asidert
    Make other function and on join function add schedulerDelayedTask.
    It works on my server.

Share This Page

Advertisement