Creating command aliases?

Discussion in 'Plugin Development' started by Mattz, Jan 15, 2013.

  1. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Is there an easy way to create aliases for commands in my plugin, instead of copying the entire code for each alias?
  2. Offline

    Drkmaster83

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    if(commandLabel.equalsIgnoreCase("alias") || commandLabel.equalsIgnoreCase("alias1")
    {
    //Check for args and stuff
    }
    EDIT: The Bukkit plugin.yml setup also supports command aliases (base commands only).

    This post has been edited 1 time. It was last edited by Drkmaster83 Jan 15, 2013.
  3. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks.
    I also just discovered the cmd.getAliases() method. What does that do?
  4. Offline

    Drkmaster83

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Stick with the traditional methods. It probably checks from the plugin.yml.
  5. Online

    RainoBoy97

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Mattz
    Code:
    name: hi
    version: 3264587
    main: this.no.hi.herp
    commands:
      thisisaverylongcommandthatneedsanalias:
        aliases: [thisis, command, hi]
    
    The aliases for "thisisaverylongcommandthatneedsanalias" is now "thisis", "command" and "hi" :p
    chasechocolate and CorrieKay like this.
  6. Offline

    theguynextdoor

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Personally, i would recommend you go with RainoBoy's method of adding an alias.

    Why? well, no extra code on your behalf, just simply adding a word Also because if you are doing commands through a separate executor, i have a feeling it wouldn't work without extra code. Also i don't like the use of commandLabel. Oh and while i think about it, it's easier to read if you have say a dozen aliases in the yml than if you had a dozen commandLabel.equalsIgnoreCase("blah").
  7. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Thanks, it's work all good now.

    Just a quick thing, I'm getting the usage of the command (again), I can't see if I'm missing anything or what.

    Main class:
    Code:
    package net.thepvp.broadcaster;
    
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class AdvancedBroadcaster extends JavaPlugin {
        
        @Override
        public void onEnable() {
            this.saveDefaultConfig();
            getCommand("broadcast").setExecutor(new Commands(this));
            getCommand("bc").setExecutor(new Commands(this));
        }
        
        @Override
        public void onDisable() {
            
        }
    }
    
    Commands.java:
    Code:
    package net.thepvp.broadcaster;
    
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    
    public class Commands implements CommandExecutor {
        
        // 50 characters long
        
        AdvancedBroadcaster plugin;
        private String notificationPrefix = plugin.getConfig().getString("notificationPrefix");
        private String version = Integer.toString(plugin.getConfig().getInt("pluginVersion"));
        @SuppressWarnings("unused")
        private String savedMessage;
        private String configVariable;
        private String configValue;
        
        public Commands(AdvancedBroadcaster plugin) {
            this.plugin = plugin;
        }
        
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(plugin.getConfig().getBoolean("enableBroadcaster") == false) {
                sender.sendMessage("Unknown command. Type \"help\" for help.");
            } else {
                if(args.length == 0) {
                    if(cmd.getName().equalsIgnoreCase("broadcast")) {
                        sender.sendMessage(ChatColor.GOLD + notificationPrefix + ChatColor.GREEN + " AdvancedBroadcaster " + version + ChatColor.BLUE + ", created by Enotho");
                        return true;
                    }
                } else {
                    if(args[0].equals("edit")) {
                        if(plugin.getConfig().getBoolean("consoleEditingOnly") == true) {
                            sender.sendMessage(ChatColor.GOLD + notificationPrefix + ChatColor.BLUE + "You can only edit saved messages from the console!");
                        } else {
                            sender.sendMessage(ChatColor.BLUE + "-- SAVED MESSAGES --------------------------------");
                            //for(ConfigurationSection configurationSection : plugin.getConfig().getConfigurationSection("messages")) {
                            //    savedMessage = configurationSection.getString("message").substring(0, 42);
                            //    sender.sendMessage(ChatColor.GREEN + configurationSection.getName() + ". " + ChatColor.WHITE + "\"" + savedMessage + "\"");
                            //}
                        }
                        return true;
                    } else if(args[0].equals("config")) {
                        if(args[1].equals("get")) {
                            configVariable = args[2];
                            try {
                                configValue = plugin.getConfig().get(configVariable).toString();
                                sender.sendMessage(ChatColor.GOLD + notificationPrefix + " CONFIG: " + ChatColor.BLUE + "The value of \'" + configValue + "\' is " + ChatColor.GOLD + configValue);
                            } catch(Exception e) {
                                sender.sendMessage(ChatColor.GOLD + notificationPrefix + ChatColor.BLUE + " Unknown value \'" + configValue + "\'");
                            }
                        }
                        return true;
                    }
                }
                return true;
            }
            sender.sendMessage("test");
            return false;
        }
    }
    
    Plugin.yml has everything it needs.
  8. Offline

    devilquak

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Mattz

    Bukkit will return whatever you enter for "usage:" of the command in your plugin.yml whenever the function returns false. So if you don't want to make that message appear, just make sure your command is returning as true, not letting it reach the false at the end.
  9. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    The thing is, I don't even know how it gets down there.

    I set the return false to true, and now essentials took over with its own /broadcast command.

    This post has been edited 1 time. It was last edited by Mattz Jan 16, 2013.
  10. Offline

    devilquak

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Are you purposefully letting it reach the point where it has "sender.sendMessage("test");" ?
  11. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I'm not, actually, it doesn't show the message in chat.

    Normally the code would be...
    Code:
    public onCommand() {
    if(cmd.getName()) {
    } }
    ... but as you can see, it checks in the config file whether or not the plugin is disabled/hidden, then proceeds with the commands.
  12. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I also just noticed this error in the console:
    Code:
    2013-01-15 19:33:39 [SEVERE] Could not load 'plugins\AdvancedBroadcaster.jar' in
     folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: net.
    thepvp.broadcaster.AdvancedBroadcaster
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:184)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:305)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:230)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.loadPlugins(CraftServer.jav
    a:239)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.reload(CraftServer.java:591
    )
            at org.bukkit.Bukkit.reload(Bukkit.java:184)
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    6)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.dispatchCommand(CraftServer
    .java:514)
            at net.minecraft.server.v1_4_6.PlayerConnection.handleCommand(PlayerConn
    ection.java:979)
            at net.minecraft.server.v1_4_6.PlayerConnection.chat(PlayerConnection.ja
    va:897)
            at net.minecraft.server.v1_4_6.PlayerConnection.a(PlayerConnection.java:
    852)
            at net.minecraft.server.v1_4_6.Packet3Chat.handle(Packet3Chat.java:44)
            at net.minecraft.server.v1_4_6.NetworkManager.b(NetworkManager.java:290)
    
            at net.minecraft.server.v1_4_6.PlayerConnection.d(PlayerConnection.java:
    112)
            at net.minecraft.server.v1_4_6.ServerConnection.b(SourceFile:39)
            at net.minecraft.server.v1_4_6.DedicatedServerConnection.b(SourceFile:30
    )
            at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:59
    8)
            at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:22
    4)
            at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:49
    4)
            at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:
    427)
            at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:84
    9)
    Caused by: java.lang.ClassNotFoundException: net.thepvp.broadcaster.AdvancedBroa
    dcaster
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader
    .java:80)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:53)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:173)
            ... 21 more
  13. Offline

    devilquak

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Mattz

    That's an error with the whole plugin, it's not loading for some reason. Somewhere your code isn't quite right, it's not necessarily an issue with the code you've been talking about.
  14. Online

    RainoBoy97

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @theguynextdoor
    Finally someone that spells my name correctly!

    @Mattz
    I would think its an compiling error, or something in the plugin.yml
  15. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    It looks fine to me:
    Code:
    name: AdvancedBroadcaster
    main: net.thepvp.broadcaster.AdvancedBroadcaster
    version: 1.0.0
    
    commands:
      broadcast:
        description: Everything you need in AdvancedBroadcaster
        usage: /broadcast
        permission: AdvancedBroadcaster.broadcast
        permission-message: You don't have permission to use this command!
        aliases: [bc]
  16. Offline

    tommycake50

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    btw if you dont want to use the plugin.yml,
    just have your command call a method outside oncommand and call that same method on the alias too
  17. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I prefer to have it in the yml, but the issue I'm having is that the command returns the usage.
  18. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Just got a completely different error:
    Code:
    2013-01-16 17:57:27 [INFO] [AdvancedBroadcaster] Enabling AdvancedBroadcaster v1
    .0.0
    2013-01-16 17:57:27 [SEVERE] Error occurred while enabling AdvancedBroadcaster v
    1.0.0 (Is it up to date?)
    java.lang.NullPointerException
            at net.thepvp.broadcaster.Commands.<init>(Commands.java:13)
            at net.thepvp.broadcaster.AdvancedBroadcaster.onEnable(AdvancedBroadcast
    er.java:10)
            at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
            at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader
    .java:457)
            at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManage
    r.java:381)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.loadPlugin(CraftServer.java
    :282)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.enablePlugins(CraftServer.j
    ava:264)
            at net.minecraft.server.v1_4_6.MinecraftServer.j(MinecraftServer.java:32
    1)
            at net.minecraft.server.v1_4_6.MinecraftServer.e(MinecraftServer.java:30
    0)
            at net.minecraft.server.v1_4_6.MinecraftServer.a(MinecraftServer.java:25
    9)
            at net.minecraft.server.v1_4_6.DedicatedServer.init(DedicatedServer.java
    :149)
            at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:
    399)
            at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:84
    9)
    Main class:
    Code:
    package net.thepvp.broadcaster;
    
    import org.bukkit.plugin.java.JavaPlugin;
    
    public class AdvancedBroadcaster extends JavaPlugin {
        
        @Override
        public void onEnable() {
            this.saveDefaultConfig();
            getCommand("broadcast").setExecutor(new Commands(this));
            getCommand("bc").setExecutor(new Commands(this));
        }
        
        @Override
        public void onDisable() {
            
        }
    }
    
    Commands.java:
    Code:
    package net.thepvp.broadcaster;
    
    import org.bukkit.ChatColor;
    import org.bukkit.command.Command;
    import org.bukkit.command.CommandExecutor;
    import org.bukkit.command.CommandSender;
    
    public class Commands implements CommandExecutor {
        
        // 50 characters long
        
        AdvancedBroadcaster plugin;
        private String notificationPrefix = plugin.getConfig().getString("notificationPrefix");
        private String version = Integer.toString(plugin.getConfig().getInt("pluginVersion"));
        @SuppressWarnings("unused")
        private String savedMessage;
        private String configVariable;
        private String configValue;
        
        public Commands(AdvancedBroadcaster plugin) {
            this.plugin = plugin;
        }
        
        @Override
        public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
            if(plugin.getConfig().getBoolean("enableBroadcaster") == false) {
                sender.sendMessage("Unknown command. Type \"help\" for help.");
            } else {
                if(args.length == 0) {
                    if(cmd.getName().equalsIgnoreCase("broadcast")) {
                        sender.sendMessage(ChatColor.GOLD + notificationPrefix + ChatColor.GREEN + " AdvancedBroadcaster " + version + ChatColor.BLUE + ", created by Enotho");
                        return true;
                    }
                } else {
                    if(args[0].equals("edit")) {
                        if(plugin.getConfig().getBoolean("consoleEditingOnly") == true) {
                            sender.sendMessage(ChatColor.GOLD + notificationPrefix + ChatColor.BLUE + "You can only edit saved messages from the console!");
                        } else {
                            sender.sendMessage(ChatColor.BLUE + "-- SAVED MESSAGES --------------------------------");
                            //for(ConfigurationSection configurationSection : plugin.getConfig().getConfigurationSection("messages")) {
                            //    savedMessage = configurationSection.getString("message").substring(0, 42);
                            //    sender.sendMessage(ChatColor.GREEN + configurationSection.getName() + ". " + ChatColor.WHITE + "\"" + savedMessage + "\"");
                            //}
                        }
                        return true;
                    } else if(args[0].equals("config")) {
                        if(args[1].equals("get")) {
                            configVariable = args[2];
                            try {
                                configValue = plugin.getConfig().get(configVariable).toString();
                                sender.sendMessage(ChatColor.GOLD + notificationPrefix + " CONFIG: " + ChatColor.BLUE + "The value of \'" + configValue + "\' is " + ChatColor.GOLD + configValue);
                            } catch(Exception e) {
                                sender.sendMessage(ChatColor.GOLD + notificationPrefix + ChatColor.BLUE + " Unknown value \'" + configValue + "\'");
                            }
                        }
                        return true;
                    }
                }
                return true;
            }
            sender.sendMessage("test");
            return false;
        }
    }
    
  19. Offline

    fireblast709

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @Mattz Don't use plugin before you initialized it
    Code:java
    1. public class Commands implements CommandExecutor {
    2.  
    3. // 50 characters long
    4.  
    5. AdvancedBroadcaster plugin;
    6. private String notificationPrefix;
    7. private String version;
    8. private String savedMessage;
    9. private String configVariable;
    10. private String configValue;
    11.  
    12. public Commands(AdvancedBroadcaster plugin) {
    13. this.plugin = plugin;
    14. notificationPrefix = plugin.getConfig().getString("notificationPrefix");
    15. version = Integer.toString(plugin.getConfig().getInt("pluginVersion"));
    16. }
  20. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    This didn't change the error...
  21. Offline

    fireblast709

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    should change the error
  22. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    I had a typo, it fixed the other error, but now I'm getting the same one as earlier:
    Code:
    2013-01-16 19:10:16 [SEVERE] Could not load 'plugins\AdvancedBroadcaster.jar' in
    folder 'plugins'
    org.bukkit.plugin.InvalidPluginException: java.lang.ClassNotFoundException: net.
    thepvp.broadcaster.AdvancedBroadcaster
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:184)
            at org.bukkit.plugin.SimplePluginManager.loadPlugin(SimplePluginManager.
    java:305)
            at org.bukkit.plugin.SimplePluginManager.loadPlugins(SimplePluginManager
    .java:230)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.loadPlugins(CraftServer.jav
    a:239)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.reload(CraftServer.java:591
    )
            at org.bukkit.Bukkit.reload(Bukkit.java:184)
            at org.bukkit.command.defaults.ReloadCommand.execute(ReloadCommand.java:
    23)
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:18
    6)
            at org.bukkit.craftbukkit.v1_4_6.CraftServer.dispatchCommand(CraftServer
    .java:514)
            at net.minecraft.server.v1_4_6.PlayerConnection.handleCommand(PlayerConn
    ection.java:979)
            at net.minecraft.server.v1_4_6.PlayerConnection.chat(PlayerConnection.ja
    va:897)
            at net.minecraft.server.v1_4_6.PlayerConnection.a(PlayerConnection.java:
    852)
            at net.minecraft.server.v1_4_6.Packet3Chat.handle(Packet3Chat.java:44)
            at net.minecraft.server.v1_4_6.NetworkManager.b(NetworkManager.java:290)
     
            at net.minecraft.server.v1_4_6.PlayerConnection.d(PlayerConnection.java:
    112)
            at net.minecraft.server.v1_4_6.ServerConnection.b(SourceFile:39)
            at net.minecraft.server.v1_4_6.DedicatedServerConnection.b(SourceFile:30
    )
            at net.minecraft.server.v1_4_6.MinecraftServer.r(MinecraftServer.java:59
    8)
            at net.minecraft.server.v1_4_6.DedicatedServer.r(DedicatedServer.java:22
    4)
            at net.minecraft.server.v1_4_6.MinecraftServer.q(MinecraftServer.java:49
    4)
            at net.minecraft.server.v1_4_6.MinecraftServer.run(MinecraftServer.java:
    427)
            at net.minecraft.server.v1_4_6.ThreadServerApplication.run(SourceFile:84
    9)
    Caused by: java.lang.ClassNotFoundException: net.thepvp.broadcaster.AdvancedBroa
    dcaster
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.net.URLClassLoader$1.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(Unknown Source)
            at org.bukkit.plugin.java.PluginClassLoader.findClass0(PluginClassLoader
    .java:80)
            at org.bukkit.plugin.java.PluginClassLoader.findClass(PluginClassLoader.
    java:53)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.Class.forName0(Native Method)
            at java.lang.Class.forName(Unknown Source)
            at org.bukkit.plugin.java.JavaPluginLoader.loadPlugin(JavaPluginLoader.j
    ava:173)
            ... 21 more

    This post has been edited 1 time. It was last edited by Mattz Jan 17, 2013.
  23. Offline

    fireblast709

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    apparently there is a problem with 'main' in plugin.yml. It cannot find the main class ;3
  24. Offline

    Miner_Fil

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Have you put the wrong path?
    Check your plugin.yml
    and it will probably look like this
    main: et.thepvp.broadcaster
  25. Offline

    Sagacious_Zed Bukkit Docs

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    the value of main must be the fully qualified name of the class which you extend JavaPlugin.
  26. Offline

    Mattz

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    @fireblast709 I can see that, but I have no idea what causes the problem.

    @Miner_Fil Looks fine to me (maybe the computer is playing tricks on me!)
    [IMG]

    @Sagacious_Zed What do you mean by that?

    This post has been edited 2 times. It was last edited by Mattz Jan 17, 2013.
  27. Offline

    Miner_Fil

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    Mattz, You need to remove @Override annotations maybe thats why it dosent work
  28. Offline

    Miner_Fil

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    i made a few changes which will make it work
    Code:
    package net.thepvp.broadcaster;
     
    import org.bukkit.plugin.java.JavaPlugin;
     
    public class AdvancedBroadcaster extends JavaPlugin {
     
    public static AdvancedBroadcaster plugin;
     
        public void onEnable() {
            this.saveDefaultConfig();
            getCommand("broadcast").setExecutor(new Commands(this));
            getCommand("bc").setExecutor(new Commands(this));
        }
     
        public void onDisable() {
         
        }
    }

    This post has been edited 1 time. It was last edited by Miner_Fil Jan 17, 2013.
  29. Offline

    fireblast709

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    nope, wouldn't cause the problem
    Miner_Fil likes this.
  30. Offline

    Miner_Fil

    dev.bukkit.org profile:
    CFUSERNAME
    My Plugins (CFCOUNT)
    Minecraft account:
    MCUSERNAME
    well he has to add the public static AdvancedBroadcaster plugin;

Share This Page