when you entered execute and subcommand, you must use {} on the both side, and there is a new components in it.
For example:
/execute @a ~~~ {["clear @s diamond 0 1","clear @s glass 0 1"]},{"chain":["give @s diamond_sword","true"]}
it means "clear a diamond and a glass from anyone, and give anyone whose diamond*1 has been cleared a diamond sword"
"chain" can connection the commands in the [].
"true/false" means Conditional, the command only execute on whom the last
chained command executed successful
if you don't have both a diamond and a glass, each of yours still will be cleared 1, but if you have both, you would be gived a diamond sword after they were cleared
ex2:
/execute @e[type=zombie] ~~~ detect ~~2~ air 0 {["clear @s iron_ingot 0 0"],["effect @s clear""]},{"chain":["say hi","true"]}
it means "if zombies' position y+2 is air, their iron_ingot can be cleared 0, and their effects can be cleared, they will say hi."
the command is able to have up to 64 chains, and there is no limit how many commands a chain you need to enter
Please sign in to leave a comment.
2 Comments