Can someone please explain the /setblock
command?
I want a command block to set a block if there is clay but not set a block if there is black wool. How do I do this?
The syntax for setblock is as follows:
/setblock <x> <y> <z> <blockName>
The setblock command can only be used for one block at a time. It cannot replace that block based on what it previously was.
Since your situation requires you to (presumably) fill more than one block, the /fill
command would be more appropriate.
The syntax for filling only blocks of a certain type is as follows:
/fill [x1] [y1] [z1] [x2] [y2] [z2] [BlockToFill] 0 replace [BlockToBeReplaced]
So to replace all clay in the world, you would use this command:
/fill [x1] [y1] [z1] [x2] [y2] [z2] [BlockToFill] 0 replace minecraft:clay
Simply replace the x
y
z
x2
y2
z2
values with the co-ordinates to fill, and [BlockToFill]
with the ID of the block you wish to replace the clay with.