Suggested name: BetterServerMessage What I want: To simply change the way the 'say xy' command in the console is being displayed. Example: Normal: [Server] Message How it could be: [Admin]: Message Ideas for commands: No commands needed for this plugin. Ideas for permissions: No permissions needed for this plugin.
Here you go! https://dl.dropboxusercontent.com/u/35900863/consolename.jar Will create a config: Code: console: name: '&2[Server]' color: '&4' It also supports colors inside the message edit: source: Main (Move your mouse to reveal the content) Main (open) Main (close) Code:java package us.kodfod.console; import java.io.File;import org.bukkit.Bukkit;import org.bukkit.ChatColor;import org.bukkit.command.Command;import org.bukkit.command.CommandSender;import org.bukkit.plugin.java.JavaPlugin; public class Main extends JavaPlugin { public void onDisable(){}public void onEnable(){if (!new File(this.getDataFolder().pathSeparator+"config.yml").exists()) {Config.load(this);saveConfig();} else {}}@Overridepublic boolean onCommand(CommandSender sender, Command cmd,String label, String[] args) {if (cmd.getName().equalsIgnoreCase("say")) {if (args.length > 0) {if (sender.hasPermission("cosole.say")) {String nargs = "";for (int i = 0; i < args.length; i++) {nargs = nargs + " "+ args[i];}String name = getConfig().getString("console.name");String color = getConfig().getString("console.color");String cname = ChatColor.translateAlternateColorCodes('&', name);String cargs = ChatColor.translateAlternateColorCodes('&', color+nargs);Bukkit.broadcastMessage(cname+":"+cargs);return true;} else {sender.sendMessage(ChatColor.RED+"You do not have permissions for this!");return true;}} else {return false;}}return false;} }[/i] Config (Move your mouse to reveal the content) Config (open) Config (close) Code:java import java.lang.reflect.Field;import java.lang.reflect.Modifier;import org.bukkit.configuration.file.FileConfiguration;import org.bukkit.plugin.Plugin; public class Config { public static String console_name = "&2[Server]";public static String console_color = "&4"; public static void load(Plugin plugin) { FileConfiguration conf = plugin.getConfig(); for (Field field : Config.class.getDeclaredFields()) { if (Modifier.isStatic(field.getModifiers()) && !Modifier.isTransient(field.getModifiers())) { String path = field.getName().replaceAll("_", "."); try { if (conf.isSet(path)) { field.set(null, conf.get(path)); } else { conf.set(path, field.get(null)); } } catch (IllegalAccessException ex) { ex.getCause().printStackTrace(); } } } plugin.saveConfig(); }}