Solved Converting a String into a Player

Discussion in 'Plugin Development' started by benzimmer123, Feb 24, 2015.

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

    benzimmer123

    Been getting quite a few problems lately while making my new server, this one I have no clue what is wrong. Can anyone tell me if there is anything wrong with these lines?
    Thanks :D

    Code:
    String pvpplayer = plugin.settings.getData().getString("1v1." + e.getPlayer());
    Player player = Bukkit.getPlayer(pvpplayer);
     
  2. Offline

    Gingerbreadman

    Code:
    Player p = Bukkit.getPlayerExact(name)
     
  3. Offline

    benzimmer123

    @Gingerbreadman
    Just tested it gives an error that the name cannot be equal to null. Here is my config and how I save the config...

    Code:

    Code:
    plugin.settings.getData().set("1v1." + r.getName(), p.getName());
    plugin.settings.saveData();
    Config:

    Code:
    1v1:
      Debuffer: TheMasterAtFails

    EDIT: Found the error, it should be e.getPlayer().getName(). Thanks for the help though! :)
     
    Last edited: Feb 24, 2015
Thread Status:
Not open for further replies.

Share This Page