Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4029

DeclareCommandsEvent - allow modifying list of server commands before being sent to a client

XMLWordPrintable

    • 1.13

      Forgive me if my understanding of this is not accurate/complete. I had thought this would simply be a list of command names, but I can see it is more complicated than than.

      The server will send a declare commands packet to the client outlining all of the commands and arguments for those command available. I would like to be able to view and modify the list of nodes, removing those relating to a particular command before it is sent to a player.

      I don't really understand the format of the packet/command data, but I imagine it would be something like an Event.getNodes() which would return a collection of the nodes available, each of which would have methods to determine which command they pertain to. Along with an Event.setNodes().

      I would use this, alongside PlayerCommandPreprocessEvent, to implement a white-list for commands to avoid unexpected commands added by plugins being made unintentionally available. I would also use it to hide legacy commands which are no longer officially support on a server after being replaced/aliased, but are still available for those who are accustomed to using them. In this case the player would have permission to the command, but should not have the command promoted to them via tab complete as they shouldn't be learning to use/rely on it.

       

       

            Unassigned Unassigned
            zedwick@gmail.com Zedadias Wick
            Votes:
            1 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: