Colour Codes In Config

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

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

    Kharte321

    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
    @SuppressWarnings("deprecation")
    EconomyResponse r = econ.withdrawPlayer(player.getName(), 20);
    if (r.transactionSuccess()) {
    try {
    Thread.sleep(1000);
    } catch (InterruptedException e) {
    e.printStackTrace();
    }
    shootFireworks();
    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

    FabeGabeMC

  3. Offline

    Kharte321

  4. Offline

    I Al Istannen

    @Kharte321
    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

    mcdorli

    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