Stop Command:Command showing in tab

Discussion in 'Spigot Plugin Development' started by Jonnyo101, Oct 6, 2019.

  1. Hi when adding a command in 1.13 and typing the command the command shows like this in the tab popup box.
    How do i make the second line not show up ?
  2. That's completely normal. It's pluginname:command. (the same applies for minecraft:.. commands). That only happens if your plugin name is the same as your command. Don't think there is a real need to turn it off, but the PlayerCommandSendEvent is where you would do so.

    EDIT: Linked the wrong event. Oopsie.
  3. drives_a_ford


    Set a permission in plugin.yml. Define that permission in plugin.yml with a default (i.e false or op). Make sure you don't have said permission.

    No. That event is depracated. Due to changes in MC, it's never fired. It's handled client side.
  4. Yeah you quoted me before I remembered and edited ^^'
  5. I do not use the plugin.yml to add commands. So i can not really add a permission.
    Here is how i register the commands.
    Code (Java):
            try {
                final Field bukkitCommandMap = Bukkit.getServer().getClass().getDeclaredField("commandMap");
                final CommandMap commandMap = (CommandMap) bukkitCommandMap.get(Bukkit.getServer());

                final Constructor<PluginCommand> constructor = (Constructor<PluginCommand>) PluginCommand.class.getDeclaredConstructors()[0];
                final PluginCommand obj = constructor.newInstance(command, Core.getPlugin());


                commandMap.register(command, obj);
            } catch (final Exception e) {    
  6. drives_a_ford


    And why are you doing it this way exactly?
  7. It works better with my command builder.
    And also allows the plugin to control what commands are added !

    Also you said about adding a permission for the player to not see the command
    Wouldn't that block the player form seeing both ?
    Eg Adding /woo

    You would see

    I just want to stop the pop up box from showing the PluginName:Woo and only show Woo
  8. drives_a_ford


    Short of removing the alias from the command map, that's not possible.
    EDIT: If you do want to do that this is where it gets added.