所以我有一個插件即時消息,讓他們在消息中被踢。我希望該消息的顏色是在config.yml中設置的。繼承人我的代碼:Bukkit編碼 - 在config.yml中設置顏色代碼的踢消息
}
if (l == 2) {
settings.getData().set("" + target.getName() + "", null);
settings.saveData();
target.kickPlayer(this.getConfig().getString("BanMessage"));
target.setBanned(true);
Bukkit.getServer().broadcastMessage(ChatColor.RED + target.getName() + " " + "Has been tempbanned for 25 Minutes by " + sender.getName() + "" + "(3/3)");
Bukkit.getServer().getScheduler().scheduleSyncDelayedTask(this, new Runnable() {
public void run() {
target.setBanned(false);
}
}, 1500 * 20);
return true;
}
繼承人我config.yml:
BanMessage: You have been temp banned for 25 Minutes