Newline from config String

Discussion in 'Plugin Development' started by sam_0208, Aug 10, 2015.

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

    sam_0208

    Hello Bukkit,

    I am trying to get a String from the config but the \n is not doing his job.

    Config
    Code:
    ('&6Welcome to the server &c %player \n &6 Type &c /help &6 for a list of commands')
    Code:
    Code:
    String welcomemessage = plugin.config.getString("WelcomeMessage.Text").replace("%player",p.getName());
    
            p.sendMessage(ChatColor.translateAlternateColorCodes('&', welcomemessage));
     
  2. Offline

    Googlelover1234

    @sam_0208
    So are you just trying to send a player multiple messages if they use \n ?
     
  3. Offline

    FisheyLP

    You could instead use a StringList in the config
     
    bwfcwalshy likes this.
  4. Offline

    sam_0208

  5. Offline

    FisheyLP

    Maybe use \\n
     
  6. Offline

    sam_0208

    @FisheyLP \\n was not working i used %n in config and used this and it worked

    Code:
    String welcomemessage = plugin.config.getString("WelcomeMessage.Text").replace("%player",p.getName()).replace("%n", "\n");
    
     
Thread Status:
Not open for further replies.

Share This Page