Exp bar doesn't move? / Can't teleport to another world?

Discussion in 'Plugin Development' started by MattBlazeHD, Feb 21, 2016.

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

    MattBlazeHD

    I have created a lobby countdown for my minigame. It's ok but, they change only the level number, but the graphic bar doesn't move :p
    Anyone can say me how can I do to move it?
    My code: http://pastebin.com/Yjkfba5Z
    And, another thing.
    When the timer ends, not teleports me

    Code:
     Location loc = new Location(plugin.getServer().getWorld("Mappa1"), plugin.getServer().getWorld("Mappa1").getSpawnLocation().getX(), plugin.getServer().getWorld("Mappa1").getSpawnLocation().getY(), plugin.getServer().getWorld("Mappa1").getSpawnLocation().getZ());
                             p.teleport(loc);
    Thanks if you will help me with this two problem (y)
    And sorry for my bad english :V
     
  2. You're setting the whole level, not the experience.
     
  3. Offline

    elian1203

    First of all, use WorldCreator to register the world, I'm assuming you're trying to teleport players into a null world. Second of all, please declare a world variable. You used plugin.getServer().getWorld("Mappa1") like 4/5 times.
     
  4. Offline

    MattBlazeHD

    Ok, i just fixed the exp and the teleportation with:
    Code:
    for(Player p: Bukkit.getOnlinePlayers()){   
                            Location loc = new Location(Bukkit.getServer().getWorld("Mappa1"), -15, 64, -14);            
                                p.teleport(loc);
                            }
    Anyway, thanks for the help!
     
Thread Status:
Not open for further replies.

Share This Page