Colour Codes In Config

Discussion in 'Plugin Development' started by Kharte321, Apr 13, 2016.

Thread Status:
Not open for further replies.
  1. Offline


    Hey Does Anybody Know How To Add Colour Codes To Your Config File

    Theres My Code
    Show Spoiler

    public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
    Player player = (Player) sender;
    if(player.hasPermission(getConfig().getString("Perm2")) || (player.hasPermission(getConfig().getString("Perm1")))){
    if (label.equalsIgnoreCase("firework")) {
    player.sendMessage( getConfig().getString("Message"));
    // I Want The Colour Code To Be On The , player.sendMessage( getConfig().getString("Message")); task
    EconomyResponse r = econ.withdrawPlayer(player.getName(), 20);
    if (r.transactionSuccess()) {
    try {
    } catch (InterruptedException e) {
    return true;
    }else {
    player.sendMessage(ChatColor.RED + "You Dont Have Enough Money!! Go Get A Job");

    Theres My Config
    Show Spoiler

    Message: &b Theres A Cool Firework

  2. Offline


  3. Offline


  4. Offline

    I Al Istannen

    translateAlternateColorCodes(char, String to color (so it would be getConfig()...) )
    You know, you want to color the String you fetch from the config.
  5. Offline


    Never use thread.sleep in bukkit, use Scheduler#scheduleSyncDelayed task to delay something.

    Also, don't blindcast and use the cmd.getName instead of label
    Zombie_Striker and mine-care like this.
Thread Status:
Not open for further replies.

Share This Page