For example, i write "OMG" and the chat shows "OH MY GOD". And could add colors "&3OH &3MY &3GOD" Is a great idea! Sorry for my english. Greetings for Argentina <3
I actually made a custom thing exactly like this for my old server, although I can't seem to find it, and the words were hard-coded in. I'll have a try if I have any spare time!
I dont have the time to code this plugin right now, but you can try this EventHandler Code: @EventHandler public void playerChat(PlayerChatEvent event) { event.setMessage(event.getMessage().replaceAll("OMG", "Oh My God, like TOTALLY!")); } Just make it read the words of a YML file or hard code them in Sadly though it doesnt ignore the case... yet.
So if you had a config like: Code: AutoReplace: Replace Words: - 'omg' Replacements: - '&5Oh. My. Gosh!' You'd want something like: Code:java public class AutoReplaceListener implements Listener { public String processPrint(String printout) { String temp = printout; index = temp.indexOf("&"); if(index != -1) { temp = convertToColor(temp); /* The convertToColor method comes from the 'Colors' plugin. It's open-source on * GitHub. You just have to tweak it a bit to fit your needs here. */ } return temp; } @EventHandler public void onPlayerChat(PlayerChatEvent e) { String message = e.getMessage(); Object[] replaceWords = config.getList("AutoReplace.Replace Words").toArray(); Object[] replacements = config.getList("AutoReplace.Replacements").toArray(); for(int i = 0; i < replaceWords; i++) { if(message.equalsIgnoreCase(replaceWords.toString())) { e.setMessage(message.replaceAll(replaceWords.toString(), processPrint(replacements.toString()))); break; } } }}[I][/I] Keep in mind: I'm not an expert at Java in any way, so some things with the lists and calls may be wrong, but this is the type of format you'd basically be looking at.