Solved Java Placeholders

Discussion in 'Plugin Development' started by 615283, Jan 29, 2018.

Thread Status:
Not open for further replies.
  1. How can I create placeholders in java and use them within a config file which is read to a player upon an event or command. For example a customisable death message and in the death message that can be set by the server owner, you can have a %PLAYERNAME% placeholder.
     
  2. Offline

    timtower Administrator Administrator Moderator

    @615283 String#replace("what to replace", "with what");
     
  3. Is the # required?

    EDIT:
    Please can you also send an example section of code which utilises this.
     
    Last edited: Jan 29, 2018
  4. Offline

    timtower Administrator Administrator Moderator

  5. The # is known as a method reference. What it means is (not technically but commonly used for) , get an instance of String and then call yourString.replace(args); on it

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

Share This Page