PT-BR EN ES
Channel Icon

Crazy Ozz

Official Channel Website

Command Block

How to Detect if a Player is Walking in Minecraft

Minecraft Java Edition 1.21+ and 26+ (Scoreboard + Command Blocks)

In this tutorial, you will learn how to detect when a player is walking in Minecraft Java Edition 1.21+ using a scoreboard and command blocks. This is useful for custom maps, triggers, automatic systems, and advanced mechanics.

Let's start by creating a scoreboard that adds points when the player walks.

scoreboard objectives add walking custom:walk_one_cm

After that, place a Repeat command block set to (Always Active) with the following command:

execute as @a if entity @s[scores={walking=1..}] run say Walking!

In the same direction as the Repeat command block, place a Chain command block (connected to the Repeat block) and set it to Always Active, using the command below:

execute as @a if entity @s[scores={walking=1..}] run scoreboard players set @s walking 0

The idea is to detect if the player walked in the Repeat command block and run a command; in this case, we run say.

And in the Chain command block, we reset the score, indicating that the player might be standing still and stopping the say command from running.

Want cheap and lag-free Minecraft hosting?

I recommend Sparked Host: affordable plans, great performance, easy panel and fast support.

🚀 Start your Minecraft Server

Still have questions? Watch the video below