I’m using the lower level command API. I’m receiving “@p” as an argument to one of my commands, executed via a command block and I’d like to parse it to the nearest player. I’m using:
Then it’s a potential improvement to the selectors API that could be made? Or maybe it should be left as it is since not everyone parsing selectors would need it to be ordered…
If they did decide to order it, should it be a random order for random selectors, and distance ordered for closest x players? What about when it’s set to all players?
Maybe leaving it as a set is best, then people who need to sort can do so.
@Kippers, is it only @p that you are receiving? I thought that generally only returned a single result unless flags were added to the selector? In that case I wouldn’t expect more then 1 entity in the set?
Mentioning @kenzierocks because your name comes up in the SelectorResolver source code.
I’m using the lower level command API because it suits my needs. I have my own annotation based command handling. How so? Do you mean selectors are automatically parsed if I use Sponge’s? If so I can check to see how they resolve it. I would guess they make use of the same Selector though.
Yeah shouldn’t have said ordered, should have said filtered.
No, @p was just an example. What I’m trying to say is that Selector.parse does not seem to behave like (I think) it should. Let me show you what I mean: