X

NOTICE

Are you sure you want to report this?

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

5

Condition for "/execute" command

3 Comments

Post a new comment:

Please sign in to leave a comment.

  • 0
    Alex Tyrer commented
    Comment actions Permalink

    You could always use an ! to signify that you don't want those conditions(in a separate command block),

    for example: tag=!player1 . 

  • 0
    UserTeemu commented
    Comment actions Permalink

    If you want to have something like:
    /execute if entity @a[distance=..5] run say close else tp @a ~ ~ ~

    You can already use these 2:
    /execute if entity @a[distance=..5] run say close
    /execute unless entity @a[distance=..5] run tp @a ~ ~ ~

  • 0
    TakiroRyo commented
    Comment actions Permalink

    Although I agree with the previous comments that the ELSE-Subcommand often can be substituted by just another command, I think it would enhance readability and make scripts in mcfunction files easier to understand, and also would reduce the need of an additional command block in situations where space is very limited and command blocks can't be chained by placing them next to each other. Also every command block saved is a plus, in my opinion, since complicated mechanisms with a lot of command blocks are hard to maintain or change, especially since you can't overlook the whole "script" at once like you could in a mcfunction file.