%player% in config?

Discussion in 'Plugin Development' started by DSCxSander, Jan 20, 2017.

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

    DSCxSander

    Hey!

    I wonderd how you can make the code for %player% in a config.

    I want to make a plugin with a customable messages in the config, with a player name in it.
    Somebody that can explane this to me?

    Thanks.
     
  2. Offline

    AL_1

    When you get a value from the config, just replace all "%player%" with the players name
     
  3. Offline

    johnny boy

    Use
    Code:java
    1. string.replace("%player%", "What you want to replace it with");
     
    tyler672 likes this.
  4. Offline

    FrostDevStudios

    What i use for this is
    String player = getConfig().getString("Path.to.message");
    player = player.replace("%player%", player.getName());

    Sent from my SM-G935P using Tapatalk
     
Thread Status:
Not open for further replies.

Share This Page