-
-
Notifications
You must be signed in to change notification settings - Fork 374
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add EffDoIf #1536
Add EffDoIf #1536
Conversation
Nice idea! I was thinking about this lol. I think execute stop
do ban the player
execute execute player command ""
do make player ride target Also what happens if you nest do ifs? stop if {_x} set if {_y} is not set
(stop if {_x} set) if {_y} is not set Both shouldn't work since it uses regex and already it shoudn't work i think. |
Yeah I agree the do/execute part doesn't sound very good and yeah nested ifs don't work |
I'm not sure if I like this idea, it's not like the alternative is much harder to write. The parser is already not so good at handling long lines. A couple of things ignoring my concerns:
|
they're not nestable |
I don't see where in the code you enforce that |
it doesn't work |
you shouldn't just rely on the parser being dumb, though... best to check in init |
@Pikachu920 The parser will read the code from the right and it uses regex So when you use And in this case you can't understand if the first regex is also a Do If effect. BTW |
Pikachu is right it doesn't hurt to guarantee it |
That change won't affect anything. |
Define what you're changing in the title of the git commit, rather than just After the Examples:
Also have you tested if time states work?
In my opinion I like IIF/ternary better but both are grammatically correct for an English based scripting language.
|
@TheLimeGlass Your examples will work the same since he didn't make his own parser. |
@TheLimeGlass this wouldn't even work when used normally already, #671 |
Then fix it |
When this will be added? |
It's already added. |
As you can see by the purple "Merged" ... that means it's been added. It was actually added back in 2.3 |
Yes. Okay so merged = closed + added now I understand. And what the red is Travis fixes, forgot import, and fixed eff not working? |
Target Minecraft versions: any
Requirements: none
Related issues: none
Description:
This executes an effect if a condition is true. The syntax is
[(do|execute)] <.+> if <.+>
where the first regex is an effect and the second is the condition.Ex:
Standalone this effect does not conflict with ternaries but if a ternary is used within the effect parenthesis must be used: