First plugin

Discussion in 'Spigot Plugin Development' started by rockdog66, Jul 13, 2015.

  1. Hey I've been working on a new plugin but I cant get the commands to work like it will say unknown command bla bla but I have made the command and I have the plugin installed heres my code

    package me.yolo.LuckyFish;

    import java.util.logging.Logger;

    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.configuration.file.YamlConfiguration;
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    import org.bukkit.plugin.java.JavaPlugin;
    public class LuckyFish extends JavaPlugin implements Listener, CommandExecutor
    {
    public final Logger log = Logger.getLogger("Minecraft");
    public int actionId;
    public int kits;
    public int kits1;
    public int kits2;
    public int kits3;
    public int kits4;
    public int kits5;
    public boolean enabled;
    public YamlConfiguration config;
    public void onEnable()
    {
    log.info("[LuckyFish] Has Been Enabled!");
    getConfig().options().copyDefaults(true);
    saveConfig();

    }

    public void onDisable()
    {
    log.info("[LuckyFish] Has Been Disabled");
    }





    public boolean onCommand(CommandSender sender, Command command, String Label, String[] args)
    {
    if (command.getName().equalsIgnoreCase("lfr")) {
    Player player = (Player)sender;
    if(player.hasPermission("lf.reload"));
    this.saveConfig();
    this.reloadConfig();
    this.saveConfig();
    sender.sendMessage(ChatColor.AQUA + "(LuckyFish)" + ChatColor.GREEN + "Config has been reloaded!");
    }
    return true;
    }}


    Thanks anyhelp is wanted
     
  2. Nope but adding it now.
     
  3. Wow. I feel stupid now. It worked Thanks for the help :)