#(jironis) Space tab completions
1 messages · Page 1 of 1 (latest)
(jironis) Space tab completions
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
.parse[unescaped] will return an elementtag; if_null[] will return <empty>
your tag failed because <context.args.first> returned invalid because the the returne value from the initial tag fragment <context.args> was li@, an empty list
your debug says that word for word, also)
odd that's in the guide like that though
due to it being empty, it returns us the same as with tab's complement 2 or 3
Is there nothing we can do about this?
Example:
my_command:
type: command
name: mycmd
description: Does something
usage: /mycmd <<>arg<>>
permission: dscript.mycmd
tab completions:
1: yn|another
2: <context.args.first.equals[yn].if_true[no|yes].if_false[]>
script:```
mycmd command which have tab completions `yes / no` after `"yn"`
в чем твоя проблема?
ого
попробуй использовать <context.args.get[1].equals[yn].if_true[no|yes].if_false[]>
я не могу сделать таб комплишн
context.args - лист, .get[1] получает значения в этом листе
так же
в твоем случае это 1
мне нужно сделать если пусто то не предлагать ничего
тебе это кидает?
да
чем бы помог .parse[unescaped]
не работает
я нашёл интерестную вещь если if_false заменить на if_null[да] то выводит корректно:
если сделать if_null[]
если значение пустое то работает как нужно
Но VScode на это жалуеться
нужно позвать кого-то повыше разобраться но мой английский на уровне 5 класса (это если с переводчиком)
я всегдс просто его и юзаю
Please stick to using English for supports chats here, that way we can make sure all advice given is accurate and/or correct any mistakes
If you're using a translator I would recommend https://www.deepl.com/translator, it's usually better than Google translate
He uses this code
Example:
my_command:
type: command
name: mycmd
description: Does something
usage: /mycmd <<>arg<>>
permission: dscript.mycmd
tab completions:
1: yn|another
2: <context.args.first.equals[yn].if_true[no|yes].if_false[]>
script:```
mycmd command which have tab completions `yes / no` after `"yn"`
when you enter not "yn", he gets this one
More precisely, this
How can I fix this error?
If you put if_null instead of if_false, it will work, but Vscode does not approve of it.
context.args.first gets the first argument, if there is no first argument it will error
that can't be fixed?
You can use something like .if_null[] to make it return nothing if it can't find the first argument (and the tag errors)
if_null wouldn't replace the if_false, that's still part of the tag - you add it to your existing tag after the if_false
А, точно ведь
Если ты не создаешь первый аргумент , то и второй появится не может, поэтому и ошибка
thank you
And then why does it go to the 2nd argument at all, if the first one has not yet been set
^
That's just how Minecraft/Spigot works, when you type a space it thinks you're done with the first argument, whether you actually specified one or not
Thread closed as resolved.
@atomic pollen
Thread was manually reopened by @granite palm.