Open CortexPE opened 5 years ago
There should also be selectable block positions / vector3 positions... ree
This one should be done on Vector3Argument
Why would you run onRun() multiple times? Just return the array of entities in the argument class and the command can loop over them or whatever?
Sure, that'd be better
ad5001 already implemented this sometime ago Maybe his project can provide some answers https://github.com/Ad5001/PlayerSelectors
It's unreadable :joy:
https://github.com/Ad5001/PlayerSelectors/blob/master/src/Ad5001/PlayerSelectors/selector/Selector.php#L105-L122 why doesn't github show code snippets smfh
I might implement a way to build your own parsers and selectors... and the default provided TargetArgument
will have the vanilla ones. for the sake of customizability and extensibility
How should this work... literally.
The only thing that I can think of that would be "good enough" is a separate
SelectableEntityArgument
class which would be parsed and the results will be an array of results.The array will contain entities that satisfied the conditions given by the user... such as
name
,limit
, etc.This would also involve running
onRun
several times for each argument that is selectable and for each of its results. Then$args["argumentName"]
will contain an entity for every iteration.This is a simply but effective way of doing it, but I still have some thoughts that it's dirty.
Leave suggestions below...