#Command autocomplete

1 messages · Page 1 of 1 (latest)

hard raft
#

Hey! I've tried to make an TabCompleter class, but it tries to autocomplete the first argument, how do i make it autocomplete the second argument, and not the first

#

Command autocomplete

bitter jungle
#

stop doing complete on args[0] and do it on args[1]

hard raft
#

how tho

bitter jungle
#

type 1 instead of 0

hard raft
#

I'm new to this

bitter jungle
#

your code literally looks for a single args

hard raft
#

Im trying to make it depend on the first argument

naive citrus
#

so do a check for that as well then

hard raft
#

I am

#

in the switch statement

naive citrus
#

show the whole method please

#

not just thisd part

hard raft
bitter jungle
#

I don't understand, you want them to type /command paste then your cache gets shown?

hard raft
#

yes

#

so the user doesnt have to type out the whole UUID

bitter jungle
#

well your code needs to test for length = 2

naive citrus
#

yea

#

indeed

bitter jungle
#

2 is when the player has pressed space after typing paste

hard raft
#

alr

naive citrus
#

also why not make the class where your command is also implement TabCompleter

#

makes it much more clean

hard raft
#

This is just an experimenting/learning plugin

naive citrus
#

ah alr

molten arrow
#

handles autocompletion and different command types for you while still being able to add your own parsers

#

also useful if you want to port your commands to a different platform, eg bungee -> velocity or paper -> jda, etc etc

#

(@hard raft for the notification)

hard raft
#

I've already fixed this

#

But thanks anyway