Error when registering command

Discussion in 'Plugin Development' started by ThedbCoders, Jan 20, 2013.

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


    So im starting on a plugin but im getting an error, Here the error & code:

    2013-01-20 19:24:54 [INFO] Starting minecraft server version 1.4.6
    2013-01-20 19:24:54 [INFO] Loading properties
    2013-01-20 19:24:54 [INFO] Default game type: SURVIVAL
    2013-01-20 19:24:54 [INFO] Generating keypair
    2013-01-20 19:24:55 [INFO] Starting Minecraft server on *:25565
    2013-01-20 19:24:55 [INFO] This server is running CraftBukkit version git-Bukkit-1.4.6-R0.1-b2561jnks (MC: 1.4.6) (Implementing API version 1.4.6-R0.1)
    2013-01-20 19:24:55 [INFO] [ReserveMe] Loading ReserveMe v1.0
    2013-01-20 19:24:55 [INFO] [AdvanceKick] Loading AdvanceKick v1.0
    2013-01-20 19:24:55 [INFO] Preparing level "world"
    2013-01-20 19:24:55 [INFO] ----- Bukkit Auto Updater -----
    2013-01-20 19:24:55 [INFO] It appears that you're running a Beta Build, when you've specified in bukkit.yml that you prefer to run Recommended Builds.
    2013-01-20 19:24:55 [INFO] If you would like to be kept informed about new Beta Build releases, it is recommended that you change 'preferred-channel' in your bukkit.yml to 'beta'.
    2013-01-20 19:24:55 [INFO] With that set, you will be told whenever a new version is available for download, so that you can always keep up to date and secure with the latest fixes.
    2013-01-20 19:24:55 [INFO] If you would like to disable this warning, simply set 'suggest-channels' to false in bukkit.yml.
    2013-01-20 19:24:55 [INFO] ----- ------------------- -----
    2013-01-20 19:24:55 [INFO] Preparing start region for level 0 (Seed: -8375517133147294036)
    2013-01-20 19:24:56 [INFO] Preparing spawn area: 40%
    2013-01-20 19:24:57 [INFO] [ReserveMe] Enabling ReserveMe v1.0
    2013-01-20 19:24:57 [INFO] [ReserveMe] Plugin successfully enabled.
    2013-01-20 19:24:57 [SEVERE] Error occurred while enabling ReserveMe v1.0 (Is it up to date?)
        at me.thedbcoders.reserveme.main.onEnable(
        at org.bukkit.plugin.SimplePluginManager.enablePlugin(
        at org.bukkit.craftbukkit.v1_4_6.CraftServer.loadPlugin(
        at org.bukkit.craftbukkit.v1_4_6.CraftServer.enablePlugins(
        at net.minecraft.server.v1_4_6.MinecraftServer.j(
        at net.minecraft.server.v1_4_6.MinecraftServer.e(
        at net.minecraft.server.v1_4_6.MinecraftServer.a(
        at net.minecraft.server.v1_4_6.DedicatedServer.init(
    2013-01-20 19:24:57 [INFO] [AdvanceKick] Enabling AdvanceKick v1.0
    2013-01-20 19:24:57 [INFO] [AdvanceKick] Plugin loaded.
    2013-01-20 19:24:57 [INFO] Server permissions file permissions.yml is empty, ignoring it
    2013-01-20 19:24:57 [INFO] Done (1.835s)! For help, type "help" or "?"
    Main class:
    package me.thedbcoders.reserveme;
    import java.util.HashSet;
    import java.util.logging.Logger;
    import me.thedbcoders.reserveme.commands.reserveme;
    import org.bukkit.Bukkit;
    import org.bukkit.plugin.PluginManager;
    public class main extends JavaPlugin{
    public String prefix = "[ReserveMe] ";
    public PluginManager pm = Bukkit.getServer().getPluginManager();
    public static final Logger mclog = Logger.getLogger("Minecraft");
    public HashSet <String> reservedplayers = new HashSet <String >();
    public int reserved = 0;
    public void onEnable(){ + "Plugin successfully enabled.");
    this.getCommand("reserveme").setExecutor(new reserveme(this));
    public void onDisable(){ + "Plugin successfully disabled.");
    this.reserved = 0;
    public void registerEvents(){
    //new join(this);
    Command class:
    package me.thedbcoders.reserveme.commands;
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    import org.bukkit.entity.Player;
    import me.thedbcoders.reserveme.main;
    public class reserveme implements CommandExecutor {
    public static main plugin;
    public reserveme(main instance){
    plugin = instance;
    public boolean onCommand(CommandSender sender, Command cmd, String CommandLabel, String[] args){
    if(sender instanceof Player){
    if(args.length == 0){
    sender.sendMessage(ChatColor.GREEN + "You are already reserved!");
    sender.sendMessage(ChatColor.GREEN + "You are now reserved!");
    sender.sendMessage(ChatColor.RED + "Wrong usage, /reserveme");
    if(!(sender instanceof Player)){
    sender.sendMessage("This is an ingame command, Console commands comming soon!");
    return false;
  2. Offline


Thread Status:
Not open for further replies.

Share This Page