@NinjaStix taught me this way, its a little bit hacky, but works: Code (Text): e.setMessage("chat format"); e.setFormat(e.getMessage());
Check the console for an exception. If the the message is not broadcasting then something is going wrong inside the method, or before the method is even called. Paste your stack trace, if any.
I don't have errors. I have tried to debug with messages. The input was String '%displayname%: %message%' and Player bys1 Before returning you see a broadcast in my method, that doesn't broadcast anything.
instead of doing Code (Java): format = format.replaceFirst("%displayname%",""); formats.add(player.getDisplayName()); try this replacing method Code (Java): format = format.replace("%displayname%", player.getDisplayName());
I think your getting caught in an infinite loop "while (format.indexOf("%") > -1) {" after you test the plugin let the server run for a couple mins. if the server hangs this is the case. I'm sorry I didn't see your reply popup earlier, I somehow missed it I guess. EDIT: If this code is in the AsyncPlayerChatEvent then I am thinking it might not hang the server(can't think rn). Try to print a debug message inside the while loop to see if the condition is ever met. Sorry if nothing I've typed makes any sense, I am really tired.
Your method is pretty unefficient and hard to overview. If you want to replace for example the player name, use @MadMaxCookie 's method. If you learned a similar method like yours from a tutorial, you should search for a new one.
expanding idea if you are watching or reading tutorial you have to learn code before using it. So that you can create your own method more efficient or edible.