Replace blocks when broken in 1.9 minecraft
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!