How do you use the /setblock command to place down more than one layer of snow

The /setblock command can place the snow layer block like so, /setblock ~ ~ ~ snow_layer, but how do you increase how many layers are placed?


Solution 1:

Top snow/snow layers use their data value to store how many layers it is. Data value 0 is 1 layer, data value 1 is 2 layers and so on until data value 7 is 8 layers.

To use this in a setblockcommand you would use /setblock x y z snow_layer [data value].