Error for bold chatcolor

Discussion in 'Plugin Development' started by GodzillaFlame42, Jul 21, 2016.

Thread Status:
Not open for further replies.
  1. I dont know why but for some reason my chatcolor.bold has an error to it.

    Here is the code.
    Code:
    package me.godzilla150;
    
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.permissions.Permission;
    import org.bukkit.plugin.PluginManager;
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class pl extends JavaPlugin {
       
        @Override
        public void onEnable() {
            getLogger().info("MineBoundSuite has been enabled!");
        }
       
        @Override
        public void onDisable() {
            PluginManager pm = getServer().getPluginManager();
        }
       
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
           
            if (cmd.getName().equalsIgnoreCase("pl") && sender instanceof Player) {
                Player player = (Player) sender;
               
                player.sendMessage(ChatColor.DARK_AQUA + ChatColor.BOLD + "SERVER" + ChatColor.DARK_GRAY + " ยป " + ChatColor.AQUA + "MineBound" + ChatColor.GRAY + " developed by" + ChatColor.RED + " Quantiii" + ChatColor.GRAY + ".");
        }
        return false;
         }
    }
     
  2. Offline

    Zombie_Striker

    Don't log your own plugins. Bukkit does this for you. Remove this line.

    Follow Java naming conventions. Class names should be descriptive and should start with an uppercase letter.

    This method does nothing. You can delete the whole method.

    Main problem: You need to has a string in between chatcolors. Add "" to fix the problem.

    Only return false when something failed. If the command worked as intended, then return true.
     
    cococow123 likes this.
  3. Offline

    Chintzi

    @GodzillaFlame42 Use ChatColor.DARK_AQUA + ChatColor.BOLD.toString() if your putting two chatcolors together make sure to put the toString() method on the second one.
     
Thread Status:
Not open for further replies.

Share This Page