using /setblock to place a colored bed in Minecraft 1.12
So I tried placing a white bed using the setblock command, like I did below
/setblock ~ ~ ~ bed 0
I used "0" because that's the data value for a white bed. But this did not work and it only placed half of a red bed. I don't know if this is a bug or what please explain the correct to do this using only command blocks to place a full colored bed in Minecraft 1.12.
So after searching around the internet for a while I found out beds do have an NBT tag for color in 1.12 this command worked for me:
/setblock ~ ~ ~ bed 0 destroy {color:0}
of course that only placed half a bed for me so I had to follow up with:
/setblock ~ ~ ~ bed 8 destroy {color:0}
to change the color you only have to change the zero to a different number between 0 and 15
The bed consists of two blocks, so of course you need to specify both. To get the data value for the other half, or any information about 1.12.2, you can always just look at past versions of Minecraft wiki pages, like here: https://minecraft.gamepedia.com/index.php?title=Bed&oldid=1162371#Block_data