PT-BR EN ES
Channel Icon

Crazy Ozz

Official Channel Website

Command Block

How to Detect if a Player is Sneaking in Minecraft

Minecraft Java Edition 1.21+ and 26+ (Execute Command Sneak Detection)

In this tutorial, you will learn how to detect if a player is sneaking in Minecraft Java Edition 1.21+ and 26+ using the /execute command. This method is perfect for creating automatic systems such as effects, messages, secret doors, minigames, and custom mechanics that activate when the player crouches.

Use the command below to detect when the player is sneaking, based on the eyes being "lower than normal".

execute as @a at @s anchored eyes positioned ^ ^ ^ positioned ~ ~-1.27 ~ if entity @s[distance=..0.1] run say I'm sneaking!

Remember that it is executed for all players.

And you can place any command you want after run.

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