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?
Arqade is a question and answer site for passionate videogamers on all platforms. It only takes a minute to sign up.Sign up to join this community
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
/execute if entity @p[tag=tagA] if entity @p[tag=tagB] run say hello worl