Skript

Skript

743k Downloads

Multiple Checks in One Condition with "and"

aaaeeeMC opened this issue ยท 4 comments

commented

Suggestion

For example: if {_time} > 0 and player's tool is a sword:
You are able to check for multiple conditions at once in the same line.
You can also check for more than 2 conditions. Example: if player's tool is a cake and block at player is a cake and player's pitch = 90:

Why?

Being able to check for multiple conditions in one line would be amazing and I don't know how it doesn't even exist yet. It allows users to save on the amount of lines and read their code more efficiently.

If this somehow isn't possible, I apologize, I saw some people mentioning "Javadocs" to check for what's possible and what isn't. I tried searching it up but to no avail.

Other

No response

Agreement

  • I have read the guidelines above and affirm I am following them with this suggestion.
commented

While I get your point for reducing the amount of lines, increasing readability is just not true. We also already have the if all: and if any: sections(?), which virtually do the same thing and are, in my opinion, far more readable than a whole line of conditions in one if statement.

commented

While I get your point for reducing the amount of lines, increasing readability is just not true. We also already have the if all: and if any: sections(?), which virtually do the same thing and are, in my opinion, far more readable than a whole line of conditions in one if statement.

agreed, but it uses more lines, doesn't more lines mean it takes longer to execute compared to just one line with the "and"s?

commented

No, it does not. They'd both execute in the same time, but the single line case would parse much slower.

commented

also you forgot to close this as unplanned or something lol