We've split up the commands, scripting and mods, and add ons category! Please be sure you get your thread in the right place.

13

New /Execute feature

3 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 3
    Registered User commented
    Comment actions Permalink

    I do like this idea but I think for the most part it is already possible just by putting 2 if clauses. Such as this for your example:
    /execute at @p if block ~ ~-1 ~ bedrock if entity @p[gamemode=survival] run effect give @p blindness 100 2
    But I see where you're coming from. It seems weird to have both ifs so adding the and so it would be more like this would help it read easier:
    /execute at @p if block ~ ~-1 ~ bedrock and entity @p[gamemode=survival] run effect give @p blindness 100 2

  • 2
    Registered User commented
    Comment actions Permalink

    /execute as @a[ gamemode= survival] at @s if block ~ ~-1 ~ bedrock run effect give @s blindness

  • 3
    Registered User commented
    Comment actions Permalink

    As TenThunder25611 stated, AND is already possible. With unless, we have NOT. What we are missing is OR in form of elseif which refers to the if before.

    Currently we have to repeat the command with different conditions but this means, that, especially with longer, more complex ones, the game has to do all the execute arguments twice:

    /execute if block ~ ~-1 ~ stone run ...
    /execute if block ~ ~-1 ~ grass run ...

    Could look like this:

    /execute if block ~ ~-1 ~ stone elseif block ~ ~-1 ~ grass run ...

    This would increase efficiency dramatically.