my plugin wont work

Discussion in 'Plugin Development' started by DiamondJava, Jun 14, 2014.

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

    DiamondJava

    package me.James.CClearChat;

    import java.util.logging.Logger;

    import org.bukkit.ChatColor;
    import org.bukkit.Location;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import org.bukkit.plugin.PluginDescriptionFile;
    import org.bukkit.plugin.java.JavaPlugin;

    public class Main extends JavaPlugin {
    public final Logger logger = Logger.getLogger("Minecraft");
    public static Main plugin;

    @Override
    public void onDisable() {
    PluginDescriptionFile pdfFile = this.getDescription();
    this.logger.info(pdfFile.getName() + " Has Been Disabled!");
    }

    @Override
    public void onEnable() {
    PluginDescriptionFile pdfFile = this.getDescription();
    this.logger.info(pdfFile.getName() + " Versoin " + pdfFile.getVersion() + " Has Been Enabled!");}

    public boolean onCommand(CommandSender sender, Command cmd, String commandLabel, String[] args){
    Player player = (Player) sender;
    if(commandLabel.equalsIgnoreCase("CC")){
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");
    player.sendMessage("");

    return false;
    }


    can you tell me what is wrong
     
  2. Offline

    Mindcraftson

    Error log?
     
  3. Offline

    DiamondJava

    like the commands dont work but it will register just its the commands

    it is just the commands that dont work but the plugin registers and everthing
    i dont know what is wrong!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 8, 2016
  4. Offline

    Mindcraftson

     
  5. Offline

    JaguarJo

    Moved thread to a more appropriate section.
     
  6. Offline

    AoH_Ruthless

    DiamondJava
    Your command doesn't do anything ... You know no message will be sent like that, right?

    You have to do player.sendMessage(" "); with a space in between to make an empty line.

    By the way, that's incredibly ugly and hurts readability. Why not just make a for loop and send a blank message 100 times. Takes 3 lines of code and will be a lot easier.
     
Thread Status:
Not open for further replies.

Share This Page