/scoreboard objectives add walking stat.walkOneCm

​​/scoreboard objectives add running stat.sprintOneCm

​​/scoreboard objectives add crouching stat.crouchOneCm

/execute @a[score_running_min=1] ~ ~ ~ detect ~ ~ ~ snow_layer -1 particle footstep ~ ~.15 ~ .1 0 .1 1 1 force

/scoreboard players reset @a[score_crouching_min=1] crouching

2- Command blocks

the number increases really fast because we're detecting for how many centimeters the player walked.


STEP TWO:

 ▶ [Set the first command block on: 'repeat' and 'always active'; set the other command blocks on 'chain' and 'always active'] The first three commands are exactly the same. The only difference between each other is that everyone works for one of the three scoreboards created. You basically need just two command blocks to make this creation work but, of course, we want it to be perfect so we applied the same 'mechanics' for when the player crouches or runs and not just for when the player walks.

These /execute commands are detecting for players that have a value (on each of the respective scoreboards) minimum of 1. If the value is 1 or more it means that the player walked, ran or sneaked for at least one centimeter.

This small bit "detect ~ ~ ~ snow_layer -1" of the command makes the command work only when the player not only has a value minimum of 1 but also when he's stepping on a snow layer. The number "-1" coming after snow layer is the data value of the block. Every minecraft block has a data value that goes from 0 to 15 and each value represents a different version of the same type of block. For example a furnace that is placed facing in different directions, changes each time it's data value. Same happens for snow layers: the thinner snow layer has a data value of "0". While the layer goes thicker, the data value also increases. Now we should have used 16 total /execute detect commands for each of the 16 total types of snow layers... here's where "-1" becomes useful. When we insert "-1" instead of one of the data values between 0 and 16, we are indicating all of them.

Finally the last part of our commands specifies which type of particle needs to be generated and in our case, we used "footstep" particles.


The last three commands are constantly resetting the scoreboard of players that have a value of 1 or higher (basically players that walked, ran or crouched for at least one centimeter) to avoid having "footstep" particles when the player stays still.

/execute @a[score_crouching_min=1] ~ ~ ~ detect ~ ~ ~ snow_layer -1 particle footstep ~ ~.15 ~ .1 0 .1 1 1 force

/scoreboard players reset @a[score_running_min=1] running

How to leave footprints on snow

1- Create scoreboard objectives

/execute @a[score_walking_min=1] ~ ~ ~ detect ~ ~ ~ snow_layer -1 particle footstep ~ ~.15 ~ .1 0 .1 1 1 force

/scoreboard players reset @a[score_walking_min=1] walking

This small command modification allows you to leave footprints on snow.

​STEP ONE:
Create scoreboard objectives.

You can write these commands in chat since they're not too long. You can run them just once.

Scoreboard objectives are really useful if you want to know when a player does a specific action in the game. In this video we saw how to detect when a player runs, walks or crouches but you can detect many more actions such as what type of item the player crafted; how many mobs killed or how many times died.

When writing the /scoreboard command you can use the TAB key to scroll all the different types of stats.

​When  the required action is performed, the scoreboard value will increase. In our case