How to override command?

Discussion in 'BungeeCord Discussion' started by btilm305, Jun 19, 2013.

  1. One of my bukkit plugins uses a command that essential to gameplay. Bungeecord is also using this command, and somehow takes priority over it. How can I make bungeecord not do this? I want to be able to use this command on the minecraft server and I don't want bungeecord using it.

    I've tried to create a bungee plugin to do this, but it didn't work. This is what I did:

    Code (Text):
    @Override
    public void onEnable() {
        BungeeCord.getInstance().getPluginManager().unregisterCommand(new CommandFind());
    }
     
  2. Could you create a Spigot alias for it? Not the solution you're looking for, but it might be a workarond?
     
  3. What do you mean?
     
    • Useful Useful x 1
  4. You cannot, to my exact knowledge, unregister the native commands. Maybe md_5 could add a, unregisterCommand() by name, and not by the object.

    (Speaking, when you unregister a new command, you literally create it, then delete it.)
     
    • Useful Useful x 1
  5. I don't have my commands in my plugin.yml, so I don't want to do this
     
  6. BungeeCord doesn't read for commands in the plugin.yml, you just have to register it by code.
     
  7. I was talking about bukkit/spigot
     
    • Agree Agree x 1
  8. Doesn't matter. BungeeCord intercepts the command before it will ever get to the server.
     
  9. That's why I'm suggesting you create an alias for the command. So you set an alias for "serv" to run "server" on the spigot server. Bungee won't intercept "serv" because it isn't a command, and Spigot will make the plugin think you ran "server".
     
  10. md_5

    Administrator Developer

    Just registering your command will override any other registered commands under the same name / alias.
     
    • Agree Agree x 1
  11. Bungee checks that? He is speaking a Spigot side command, yes?