PlayerChatTabCompleteEvent

Discussion in 'Plugin Development' started by CorrieKay, Feb 1, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    CorrieKay

    Im hoping to use this event to change the possible tab completion for specific commands. For instance, i could have it cycle through players.. Or i could have it cycle through private warps, or other specific possible inputs for the command theyre typing.

    However, unfortunately this event doesnt seem to fire when youre typing a command :\

    Ive looked in all of the obvious places, but i cant find one for if theyre doing a command. (basically, if the string starts with /, the event doesnt fire) Is there an event for the command version of this?
     
  2. Offline

    chasechocolate

    The only way might have to be done with packets, but even with packets, I don't know if it is possible. Maybe create fake commands/sub-commands?
     
  3. Offline

    microgeek

    Look at how Bukkit registers commands.
     
  4. Offline

    CorrieKay

    i actually looked at the source code, it differentiates between a command and a chat message by checking if it starts with a /. They throw an event only if it doesnt start with /. which is really weird. i dont know why they'd do that.

    I dont see how that pertains to my question.
     
  5. Offline

    microgeek

    Not bukkit, but minecraft itself, my bad. http://wiki.vg has info on all of the packets used in the game, one of which sends a list of 'auto complete' items. On phone, so I can't really send you code.

    EDIT: http://wiki.vg/Protocol#Tab-complete_.280xCB.29
     
  6. Offline

    desht

    You're right. CraftServer is the code in question, and it explicitly only sends tab complete events for chat text, never for commands (the event is called PlayerChatTabCompleteEvent, after all...). I actually looked at this too a few months back, because tab-completion on the arguments of some plugin commands would be really, really, useful.

    I seem to recall when looking at this that adding a PlayerCompleteTabCompleteEvent would be harder than maybe initially apparent, but for the life of me I can't remember why :oops: But perhaps this is your chance to get some code into CraftBukkit ;)
     
    CorrieKay likes this.
Thread Status:
Not open for further replies.

Share This Page