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

6

/execute try - if command fails/is successful

1 Comments

Please sign in to leave a comment.

Sorted by oldest
  • 1
    Registered User commented
    Comment actions Permalink

    That's already possible with some existing commands, with the help of /execute store. You can use it to save the results of commands to a storage location, and then recall the value to test if it succeeded. Why don't you try this:

    execute store success score test results run kill @a[distance=..5]
    execute if score test results matches 1 run say Killed a player!
    execute unless score test results matches 1 run say There were no players to kill...