I want it so that when an anvil gets used up, it will put another one in it's place. Someone told me to use /execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:snow 0 /setblock ~ ~-1 ~ minecraft:air 0
, but it says
"/setblock is not a valid number"
I want it so that when an anvil gets used up, it will put another one in it's place. Someone told me to use /execute @a ~ ~ ~ detect ~ ~-1 ~ minecraft:snow 0 /setblock ~ ~-1 ~ minecraft:air 0
, but it says
"/setblock is not a valid number"
If I understand correctly... You want to refill the anvil when it's broke. So use this
/execute @e[name=Anvilblock,type=ArmorStand] ~ ~ ~ detect ~ ~ ~ air 0 /setblock ~ ~ ~ anvil
It would test for every ArmorStand that named "Anvilblock" And if you want self-repair anvil just stand on where you want it to be placed and do
/summon ArmorStand ~ ~ ~ {CustomName:Anvilblock,Invisible:1,Marker:1}
Invisible make it invisible and Marker make It's hitbox's size to 0. And when you don't want it anymore, Stand near it and do
/kill @e[type=ArmorStand,name=Anvilblock,r=2]
Be sure to turn off commandBlockOutput in /gamerule
Hope that's help!
This should work. It doesn't detect for ANY anvil, only one at a specific coordinate, but it will work.
Take a repeating command block (always active) and place in the command /testforblock <coords> anvil <data value1>
, then place a chain command block (conditional) with /setblock <coords> anvil <data value2>
Now you'll have to find the coords yourself, but for the data values:
These are all your options for the data values, but they must be used together as a pair. Use whatever combination fits your scenario best.