Use {player} in config

Discussion in 'Plugin Development' started by bramhaag, Dec 30, 2013.

Thread Status:
Not open for further replies.
  1. Hey all,

    Just like the title says. How do i add {player} in an message in the config?

    Kind regards,

    Bramhaag
     
  2. Assist
    If i type {player} i want to get the player name
     
  3. Offline

    random_username

    Replace it? i.e. you want to get String "name" from the config:
    Code:java
    1. Player player = (Player) Sender;
    2. getConfig().getString("name").replace("{player}", player.getName();
     
  4. bramhaag
    I know what you meant, I just wanted you to elaborate your question.

    You can use string.replaceAll("{player}", player name), where 'string' would be the message in config, and 'player name' the name you want to use.
     
Thread Status:
Not open for further replies.

Share This Page