[SOLVED] Teleporting Between Worlds Not Honoring Coordinates

Discussion in 'Plugin Development' started by Maltheus, Aug 12, 2012.

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

    Maltheus

    So I have multiverse installed and I'm trying to use the entity teleport command to travel between worlds. It switches my world, but keeps me at whatever coordinates I teleported from, regardless of what location I pass into it. Even if I try to programmatically dispatch the "/mvtp e:world:0,0,0" command, it does the same thing (although it works from the in game command line). Am I missing something here?
     
  2. Offline

    Timr

    This query probably belongs over on the MultiVerse BukkitDev page here.
     
  3. Offline

    Maltheus

    Thanks, I've tried asking there too. But I suspect this is more bukkit related, or rather related to my lack of bukkit understanding. If I can successfully execute the command from within the game, then what could cause that to execute differently when I use Bukkit.dispatchCommand?

    For what it's worth, I'm trying to do this while processing a PlayerInteractEvent event.

    Ok, from what I can tell, this is not a multiverse issue, this is an issue with trying to use a pressure plate as a teleporter, since there's likely a move event in the queue. My guess anyway. In any case, I seem to have solved it by threading my teleport like this:

    Code:
    Bukkit.getServer().getScheduler().scheduleSyncDelayedTask( this, new Runnable() {
        public void run() {
            Chunk chunk = teleportLocation.getChunk();
     
            if (chunk.isLoaded() == false) {
                chunk.load();
            }
     
            player.teleport( teleportLocation, PlayerTeleportEvent.TeleportCause.PLUGIN );
        }
    }, 0L );
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 27, 2016
Thread Status:
Not open for further replies.

Share This Page