Why Runnable not teleported

Discussion in 'Plugin Development' started by kvq, Apr 3, 2014.

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

    kvq

    Teleport in runnable dont work .

    Code:java
    1. public class main extends JavaPlugin implements Listener {
    2. private Plugin plugin ;
    3. int jx = this.getConfig().getInt("sx") ;
    4. int jy = this.getConfig().getInt("sy");
    5. int jz = this.getConfig().getInt("sz");
    6.  


    Code:java
    1. BukkitRunnable game = new BukkitRunnable() {
    2. //private Plugin plugin;
    3. //private World loc = Bukkit.getWorld("hell3");
    4.  
    5. @Override
    6. public void run() {
    7. if (timew > 0){
    8. timew = timew - 1 ;
    9. BarAPI.setMessage(ChatColor.GOLD + "Ultra Hardcore" + ChatColor.DARK_GRAY + " - " + ChatColor.GREEN + "" + timew);
    10.  
    11. } else if (timew == 0) {
    12. BarAPI.setMessage(ChatColor.GOLD + "Ultra Hardcore" + ChatColor.DARK_GRAY + " - " + ChatColor.DARK_AQUA + "Phase 1");
    13. for(Player p : Bukkit.getOnlinePlayers()){
    14. World loc = Bukkit.getWorld("hell3");
    15. p.teleport(new Location(loc, jx, jy, jz));
    16. }
    17. }
    18.  
    19.  
    20. }
    21.  
    22. };


    Code:
    p.teleport(new Location(player.getWorld(), jx, jy, jz));
    ok , i find way

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
Thread Status:
Not open for further replies.

Share This Page