0

Is it possible to put a "double conditional" in a command block (two execute commands in the same command), like so:

/execute foo run execute bar run command

Is this possible?

2
3

Yes, it is possible. In fact, a /execute command with multiple parameters remains functionally the same if you add the words run execute in between each parameter.

For example, these two are equivalent:

/execute as @p at @s if entity @p[distance=..10] run say Hi!
/execute as @p run execute at @s run execute if entity @p[distance=..10] run say Hi!

Therefore, there is no need to place multiple /execute commands within each other. It remains the same putting all the parameters in one command.

For your double conditional, all you need to do is include multiple if/unless parameters:

/execute if entity @p[tag=tagA] if entity @p[tag=tagB] run say hello worl

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.