So many people use (in there configs) stuff like %motd% to replace that with whatever it is. How would I make that?
Code: string.replace("%variable%, whatever); Based on this question, I suggest you learn Java first... this is String manipulation which is essentially the basics of Java (and not Bukkit.)
Something along the lines of... Code: String variable = "54"; String result = getConfig().getString("Path.to.string").replaceAll("%var%", variable);
@DoggyCode™ I'd argue that there isn't any proof he doesn't. @RelicObject Don't spoonfeed, and don't use replaceAll, which uses regex, not a string. @MemeplexOwner Alright, then the method is String#replace(String, String), the first one is a pattern to find and the second is the value to replace it with. You invoke the method on a String, and it returns the transmuted String. That should be all you need. As an aside, since it returns the value as a String, you can chain the method calls, for example: Code: String var = test.replace("1", "one") .replace("2", "two") .replace("3", "three");
I dont see how i am spoonfeeding yet A5H73Y is not? Not to point finger's but he also just posted code.
Do not take it as something against you. Both you and A5H73Y spoonfed. Which arent what we do on this forum. Please try to tell him how to do it, instead of giving him the exact code that does it. Sendt fra min ALE-L21 med Tapatalk
I feel bad i clicked on the link. However i learned lots of java by coming here and get help from you guys.
I disagree with this. I posted the syntax, relevant to what he asked; If someone asked what is "Hello" in French, you'd answer "Bonjour", not a sentence which contains "Bonjour" etc.
@A5H73Y True, but there is a difference with that example. That is just asking what one simple word means and just telling the person what it means. What you are doing is giving them a full senentance, without any context to what the other words mean. If anything, you got it backwards. The reasons we do not like spoonfeeding on the Bukkit forums can be found in the How To Make a Plugin Dev Thread sticky. In that thread, it says:
This post was not made to be argued on, but I personally think @mythbusterma's response helped me the most. Thank you!