Parameters for target selectors seem to be only capable of understanding "AND" statements. For instance, @e[type=Cow,r=10] targets all entities that are both a cow AND within 10 blocks. However, OR statements are a little more tricky. Say I wanted to target anything that was either cow OR a pig, but nothing else. I'd either have to to a crap ton of NOT statements (@e[type=!Player,type=!Creeper,...] literally anything that isn't a pig or a cow), or make two commands- one for cows and one for pigs (which seems to be what most people do).
However, I think OR statements should be supported. It would increase efficiency in command creations by quite a bit, and it wouldn't have to interfere with already-existing creations. Here's how I think it should be done:
@e[type=Cow][type=Pig]
It's just a target selector with two parameter segments, each acting independently, and selected entities have to fulfill one or more of these parameters to be selected
Other examples could be like this: @e[type=Cow,r=5][type=Pig,r=10] would select cows within 5 blocks, or pigs within 10 blocks... you get the idea. Also, the amount of segments shouldn't be limited to two, just to clarify.
cool idea, but how would you then distinguish this from an AND operation? Your syntax could read either way, so perhaps do something more syntactically traditional:
@e[type=cow,r=5|type=pig,r=10] <-- the pipe symbol is the traditional operator for logical OR
@e[type=cow,r=5&type=pig,r=10] <-- the ampersand symbol is the traditional operator for logical AND
Alternatively, a clearer variation would be to move the logical operators out of the property list and use multiple commands:
@e[type=cow,r=5]|@e[type=pig,r=10]
edit: oh, yes, and what about complex comparisons? What would be used to control the order of operations?
In the above statement, the meaning is too ambiguous (is it supposed to be a cow or a pig/sheep, or a cow/pig and a sheep?) I don't know the language well, so this issue might already be handled in the current iteration.
Hi there, My name's Thurner
Parameters for target selectors seem to be only capable of understanding "AND" statements. For instance, @e[type=Cow,r=10] targets all entities that are both a cow AND within 10 blocks. However, OR statements are a little more tricky. Say I wanted to target anything that was either cow OR a pig, but nothing else. I'd either have to to a crap ton of NOT statements (@e[type=!Player,type=!Creeper,...] literally anything that isn't a pig or a cow), or make two commands- one for cows and one for pigs (which seems to be what most people do).
However, I think OR statements should be supported. It would increase efficiency in command creations by quite a bit, and it wouldn't have to interfere with already-existing creations. Here's how I think it should be done:
@e[type=Cow][type=Pig]
It's just a target selector with two parameter segments, each acting independently, and selected entities have to fulfill one or more of these parameters to be selected
เล่นคาสิโนบนมือถือ
Other examples could be like this: @e[type=Cow,r=5][type=Pig,r=10] would select cows within 5 blocks, or pigs within 10 blocks... you get the idea. Also, the amount of segments shouldn't be limited to two, just to clarify.
That's really it. What do you think?
cool idea, but how would you then distinguish this from an AND operation? Your syntax could read either way, so perhaps do something more syntactically traditional:
@e[type=cow,r=5|type=pig,r=10] <-- the pipe symbol is the traditional operator for logical OR
@e[type=cow,r=5&type=pig,r=10] <-- the ampersand symbol is the traditional operator for logical AND
Alternatively, a clearer variation would be to move the logical operators out of the property list and use multiple commands:
@e[type=cow,r=5]|@e[type=pig,r=10]
edit: oh, yes, and what about complex comparisons? What would be used to control the order of operations?
@e[type=cow,r=5]|@e[type=pig,r=10]&type=sheep,r=15]
In the above statement, the meaning is too ambiguous (is it supposed to be a cow or a pig/sheep, or a cow/pig and a sheep?) I don't know the language well, so this issue might already be handled in the current iteration.