#Execute command that place different block, depending on condition

1 messages · Page 1 of 1 (latest)

sonic cobalt
#

Is it possible in execute command that test if block is air place planks, if block is water place log. Can we chain this in single execute command?

lilac spear
#
execute if block 0 0 0 air run setblock 0 0 0 planks
#

The only way to test for waterlogged blocks is with if blocks to compare two blocks.

sonic cobalt
#

It's not waterlogged block, just a full "water" block. /setblock ~ ~ ~ water that water is I'm talking about.

What you show is it will place planks if the block detected is an air (otherwise, does nothing).

What I want to achieve is, well just read what I wrote again.

lilac spear
#

Well I can tell you that you need at least two command blocks

proper trench
sonic cobalt
#

Ahh, I said if we can chain this in single execute command. Not making 2 command. If that's what I want to achieve, I don't have to asked.

proper trench
#

Since ur challenging a space for two different potential type of blocks, no matter which of many methods u try: ull need two

sonic cobalt
#

I just wonder if this is possible, hence the new execute command has "if" and "unless", which is very useful for making condition before executing the final command. However, can only put 1 single output in condition we put.

proper trench
sonic cobalt
#

I know it can repeat multiple times, but it will only make multiple conditions and if those conditions are met, it just one single output. That's what I'm talking about.