Player tab-complete and anotherone #162


Open
  • Forge_User_04904718 created this issue Feb 24, 2018

    So i want $arg1 to be a playername (tab-completed), and $arg2 to be one of the things listed in the "tab_completer:" list

    But i actually have no idea of how to do this... Any help?

  • Forge_User_04904718 edited description Feb 24, 2018
  • L3thalBunny posted a comment Mar 9, 2019

    I could never get tab_complete to work for anything other than player names... I too would like to know if this is a bug or if I've just never been able to figure out the right way...

  • ivanfromitaly posted a comment Mar 10, 2019

    Currently you can't do both. If you pur "register: true" and stop, the command will return with the list of player names. If you use

     tab_completer: <br />  - option 1
      - option 2

     the plugin will return with that list. There are possibilities to expand that in future, but for now, it's limited in this way.

     


    Edited Mar 10, 2019
  • L3thalBunny posted a comment Mar 10, 2019

    okay so:
    tab_completer WITH register: true  = player names
    tab_completer WITHOUT register: true = provided list

    ?

     

    Just tested it and 

    test:
      command: /test
      type: RUN_COMMAND
      runcmd:
      - '$text$hello $multiargs'
      arg1_tab_completer:
      - suggestion
      - autotab

    does not seem to work, even just "tab_completer" does not seem to work. Only registering gives player names.

     


    Edited Mar 10, 2019
  • ivanfromitaly posted a comment Mar 11, 2019

     

    You still need to put register: true. If the command isn't registered can't have a tab completer on it. There is a prebuild example in the plugin, in examples.yml just check that. If that works, i can't help you.

     

    test:
      command: /test
      type: RUN_COMMAND
      runcmd:
       - '$text$hello $multiargs'

     register: true
     tab_completer:
       - suggestion
       - autotab

     


    Edited Mar 11, 2019
  • L3thalBunny posted a comment Mar 11, 2019

    copied your example and when press TAB only playernames are listed still.

  • ivanfromitaly posted a comment Mar 12, 2019

    I see, you need to restart the server if you add the line tab-completer while the server is on. Or reload only Mycommand as whole with things like Plugman, but i suggest to restart the server. You can edit the list of suggestion live once it is online, but the tab completer activate only when the command get registered, so on server start or MyCommand gets disabled and re-enabled as whole. ANd i don't think it's easy to make it update "live" without needing a restart. It's a bit complex.


    Edited Mar 12, 2019

To post a comment, please login or register a new account.