Solved Bukkit Teleport getPlayer Error

Discussion in 'Plugin Development' started by Bostrot, Apr 19, 2014.

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

    Bostrot

    Hey Guys! I am writing a little pvp plugin where players are teleported to other players in the arena. But under getPlayer is a yellow line and it is crosse out
    Code:java
    1. Player p1 = getServer().getPlayer(args[0]);

    What is the error?
     
  2. Offline

    Th3Br1x

    Bostrot i can only hve a guess, but do you use the newest Bukkit Development version?

    Edit: Meh, got bombed :) But yes, in the newer Bukkit versions, the new UUID system is used, strign based player operations are likely not working anymore (or just not wanted anymore)
     
  3. Th3Br1x They work fine, it's just that soon they won't be a guaranteed means of unique identification. :p
     
  4. Offline

    Th3Br1x

    Not exactly. Deprecated means, it will be removed someday in the future and that you should use other methods to solve your problem :) But yes, in most cases, deprecated functions still work.
     
  5. Offline

    Bostrot

  6. Bostrot I've seen a number of tutorials on the switch from name to uuid. Whether you need to switch also depends on usage. If you only want to store/use the player while they're online, then using the name is fine.

    Th3Br1x Usually, yes. But I guarantee that there will still be a method to get a player by name :p
     
Thread Status:
Not open for further replies.

Share This Page