Closed StreamVersus1 closed 2 weeks ago
Do I understand that correctly, you have multiple optional arguments and you want to skip some of them when executing the command?
No, Location argument works like 3 combined coordinate argument, and to skip Location argument, you need to skip each one of the combined argument I want to skip 1 Location Argument with one space
Can you share the command (the code) and your expected result? I still don't really know what you want to achieve.
super(main, "teleport");
withArguments(new SubTagArgument("subtag").combineWith(new PlayersBySlotArgument("slots")));
withOptionalArguments(new LocationArgument("location", LocationType.PRECISE_POSITION)); <- takes 3 spaces to skip, one for x, one for y, and one for z
withOptionalArguments(new RotationArgument("rotation")); <- takes 2 spaces to skip, one for pitch, and 1 for yaw
withOptionalArguments(new WorldArgument("world")); <- takes 1 space
Right now: 6 space to skip all arguments Expected: 1 per argument, 3 total
What do you mean by skip arguments? Do you want, for example, provide the location argument, then don't provide the rotation argument and then provide the world argument? Also if you don't want to provide any of those optional arguments, just don't write any of those.
What do you mean by skip arguments? Do you want, for example, provide the location argument, then don't provide the rotation argument and then provide the world argument? Also if you don't want to provide any of those optional arguments, just don't write any of those.
im unable to type another argument before i type space:
/teleport 'location' 'rotation' 'world'
i am unable to write'rotation' before i will at least type space in 'location' but location works like 'x' 'y' 'z' so before i can type 'rotation'>, i need to type space in 'x' 'y' 'z', which leads to ugly and weird command structure
/teleport 100 10 minecraft:overworld
Hope this will make more sense update:github ate everything, sorry
I mean, your command structure is
/teleport <subtag> <slots> <location> <rotation> <world>
So obviously, in order to get to the location, you have to type in your subtag and slots argument. If you want to type in a rotation, you also have to provide a location. That's just how commands work.
I mean, your command structure is
/teleport <subtag> <slots> <location> <rotation> <world>
So obviously, in order to get to the location, you have to type in your subtag and slots argument. If you want to type in a rotation, you also have to provide a location. That's just how commands work.
Its not problem with multiple arguments, its problem with arguments, that are made by combining another arguments and that you need to skip each of subarguments in Location, which takes 3 spaces, maybe im losing point somewhere
There is no such thing as "skipping arguments". You can't just not provide an argument that is on the path to another argument. If an argument is optional, you can choose to not provide it when executing the command but that will also disable you from providing arguments after the not provided optional argument.
oh, thanks for clarifing that i didnt expected for it to work like that Thanks
CommandAPI version
9.5.1
Minecraft version
1.20.1
Are you shading the CommandAPI?
Yes
What I did
What actually happened
Its weird that you need to press spacebar 3 times(1 per each coordinate) to get to another(possibly optional) arguments.![image](https://github.com/JorelAli/CommandAPI/assets/32746888/99662a50-95a0-4b9f-86c7-abc49dfcf7b0)
What should have happened
To prevent that, one space should skip argument fully, not just 1 input field.
Server logs and CommandAPI config
No response
Other
No response