Getting Config Section?

Discussion in 'Plugin Development' started by Chrisdamonster, Jun 8, 2014.

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

    Chrisdamonster

    I am getting this error, where eclipse is going back and forth between "player.sendRawMessage" and "player.sendMessage". Here's my code:
    Code:java
    1. ConfigurationSection read = this.plugin.getConfig().getConfigurationSection("reviews.read.");
    2. player.sendMessage(read); // <-- error
    3. player.sendRawMessage(read); //<-- error


    Which one should it be?
     
  2. Offline

    fireblast709

    Chrisdamonster You do realize that String != ConfigurationSection, right? Also, it doesn't really matter which you pick, sendRawMessage will send even if the player is in a conversation
     
  3. Offline

    Chrisdamonster

    fireblast709 If I use sendMessage, it gives me quick fix over to sendRawMessage, then when I use that, it gives me a quick fix over to sendMessage. Make up your mind eclipse. :p
     
  4. Offline

    fireblast709

  5. Offline

    Chrisdamonster

    fireblast709 -_- So then what is...

    Bump?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  6. Offline

    xTigerRebornx

    Chrisdamonster A ConfigurationSection is not a String, yet Player#sendMessage() takes in a String. Find a way to convert that ConfigurationSection to the String you want.
     
  7. Offline

    Chrisdamonster

    xTigerRebornx Er, I can't find a way to get it to be a string.
     
  8. Offline

    minecraft124_

    You can loop through the keys from the configuration section, then send those as messages.
     
  9. Offline

    fireblast709

    Chrisdamonster either you lack Java or api knowledge, but either way you should do something about it.
     
Thread Status:
Not open for further replies.

Share This Page