Solved CraftPlayer{name=CraftCreeper6}?

Discussion in 'Plugin Development' started by CraftCreeper6, Mar 2, 2014.

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

    CraftCreeper6

    Hi guys, you can probably tell by the title ^^
    Code:
    Code:java
    1. Player name = (Player) sender;
    2.  
    3. Bukkit.broadcastMessage("§L§O§1§N[CLASSIFIED INFO]" + name + "§L§O§9§N joined the lobby! ("
    4. + getConfig().get("CLASSIFIED INFO.amount") + "§L§O§9§N /"
    5. + getConfig().get("CLASSIFIED INFO.maxamount") + "§L§O§9§N)");

    Any help o.o?
     
  2. Offline

    Minecrafter_NL

    Remove :
    Player name = (Player) sender;

    And add:
    Player player = (Player) sender;
    string name = player.getName();

    Sorry i couldnt use the coding tags as im on my iPad
     
  3. Offline

    dailison

    Use this:
    Code:java
    1. Bukkit.broadcastMessage("§L§O§1§N[CLASSIFIED INFO]" + name.getName() + ".....";
     
  4. Offline

    CraftCreeper6

    Minecrafter_NL
    dailison
    Its all good! Thanks! Works perfectly! :)
    Btw, I don't know why but;
    Code:java
    1. + getConfig().get("CLASSIFIED.amount") + "§L§O§9§N /"
    2. + getConfig().get("CLASSIFIED.maxamount")
    3. + "§L§O§9§N)");
    4.  

    Does not seem to be updating :O In-game: [​IMG]
    Can you help o.o?
     
  5. Offline

    Minecrafter_NL

    I'm not sure, but i think the configuration only updates when you tell it to.
    You may want to try creating an integer for both value's and save it to the config on onDisable.
    Then load it again on onEnable
     
  6. Offline

    CraftCreeper6

  7. Don't forget to mark the thread as solved! :p
     
Thread Status:
Not open for further replies.

Share This Page