I am aware that ordinarily in Minecraft one can use:
\setblock x y z minecraft:block0 0 replace minecraft:blockname1
to set a block with the ID name: block0
on the coordinate, but only if the block which was before has ID name: block1
; this does however not seem to be the case if the block I desire to set is chest (or other blocks which can contain things, such as for instance hoppers). If I type
\setblock x y z minecraft:chest
it works fine
\setblock x y z minecraft:chest 0 replace
works as well; however
\setblock x y z minecraft:chest 0 replace minecraft:block1
(of course I don't write block1
, I instead use any real blockname)
fails with the error message:
Data tag parsing failed: Invalid tag encountered, expected '{' as first char.
I have (obviously) attempted this:
\setblock x y z minecraft:chest 0 {} replace minecraft:block1
Which does cause chest to be placed, but it does however not only do if the block that was there before had ID name: block1
.
My question: Is there a way to use the setblock command to set a chest (or other item containing blocks) but only if it replaces a specific other block?
block1
with an actual block id in your implementation, right?block1
andblock0
are only placeholders for the actual ID names