Just wondering, anyone has made something like this before, and if so, can they share their code.
If not, could you help me think this out?
I need to find a way to automatically generate a multiline message, however, messages are saved in config file with multiple lines.
I want to allow people to add their own keys, in the form of key_name_iterator
What I have now, but It's not complete at all
public String getMultiMessage(String message) {
// Trying to find a way to automatically loop through all the messages and return the value in a single string
// Example:
/*
create_info_1: "&a&m-------------------------------------------"
create_info_2: "&a "
create_info_3: "&7Usage: &a/xvote create <question> "
create_info_4: "&7<answer1> | <answer 2> | ..."
create_info_5: "&a "
create_info_6: "&a&m-------------------------------------------"
*/
ArrayList<String> matches = new ArrayList<String>();
Pattern p = Pattern.compile(message);
for (String s:Messages.getInstance().getMessageData().values()) {
if (p.matcher(s).matches()) {
matches.add(s);
}
}
StringBuilder stringBuilder = new StringBuilder();
for (int i = 1; i < matches.size(); i++)
stringBuilder.append(getString(message + "_" + i) + "\n");
String msg = stringBuilder.toString();
return msg;
}

!How can I change hover text on player list? Like picture
