Solved Get Player from name

Discussion in 'Plugin Development' started by Auke, Feb 10, 2018.

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

    Auke

    Hi,

    I'm struggling with getting a Player by its name.
    It's saying that is is depraceted: The method getPlayer(String) from the type Bukkit is deprecated

    Here's the code:
    Code:
            if (cmd.getName().equalsIgnoreCase("skull") && sender instanceof Player) {
              
                Player player = (Player) sender;
              
                if (Bukkit.getPlayer(args[0]) != null) {
                  
                    LuckyClass.giveHead(player, owner);
                  
                }
              
            }
     
  2. Offline

    timtower Administrator Administrator Moderator

    @Auke Just ignore the warning
     
    Banjer_HD likes this.
  3. It is normal for the deprecation to occur, just ignore it like timtower said and everything will be fine :)
     
  4. Offline

    Machine Maker

    Please mark this thread as Solved if your issue has been resolved.
     
  5. Offline

    Auke

    ok, thx
     
Thread Status:
Not open for further replies.

Share This Page