Detecting a teleport to a different world..

Discussion in 'Plugin Development' started by Carbunkulous, May 16, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Carbunkulous

    I hate asking so many questions :3 This is my second one of the night, I'll try to leave it at that! :p

    I need to be able to run code directly after when a player teleports from one world to the other. Currently once the onTeleportEvent is called, it reports the BEGINNING world, and not the after world. :S

    How would I achieve to figure out what that other world that they teleported too is?

    edit: To be more specific, I need to detect the teleport from MultiVerse to another world
     
  2. Offline

    4am

    You could use a timer thread and then poll for the player's location after a short time, it should report the world they've teleported to. There is probably a more elegant solution than this.
     
  3. Offline

    Dreadreaver

    inside the TeleportEvent you can use this:

    event.getFrom().getWorld();

    and:

    event.getTo().getWorld();

    problem solved
     
    4am likes this.
Thread Status:
Not open for further replies.

Share This Page