Ask Games Video Games

How do I continue a data pack function even when a command fails?

I am very new to data packs, and while messing around with /execute I ran into a problem. As of 1.16.1 there is no "else" subcommand for the /execute command, meaning I have to do something like this:

/execute if score #value foo matches 1 run say 1
/execute if score #value foo matches 0 run say 0

That works fine if the score foo returns as 1, but if it does not return as 1 then the function stops running. I need a way to just continue the function, unless there is something like an "else if" feature that I am missing.

I am playing on Java Edition 1.16.1

Leave a Reply

Your email address will not be published. Required fields are marked *