Can you test in Minecraft if man is running against a wall and is not just standing against the wall?

Li
5

Can you test in Minecraft if man is running against a wall and is not just standing against the wall?

Ac

Create a scoreboard for running, test for higher values than 0 and reset afterwards. As long as the test is true, the player is running.

Di

I think you can do it programming

take value x (from the player running in one direction) and how fast that value approaches the wall and then stops. If this x value has a certain value then it's like running against a wall

Av

You can execute a command with 1 ^ in the direction of view

If 1.14

/ execute as @a at @a if block 1 ^ minecraft: stone run say hi

So you ask if 1 block in front of you is a block of stones

But if you want to test in general on block before you can create a scoreboard (dummy)

And then it depends on whether you write it in a function or in Command_Blocks

But first the value of the variable must au.b. Zero are set then you ask with the Upper Command whether in front of the player is a block of air (minecraft: air) if so you set the value of the player to 1 so now you know that the value of the player must be 0 behaviors if he towards the wall because the value is not set to 1. Do you mean Lord then as any player who has the value 0 has your command or what you want to stop

And so the value is set to 0 every tick if then on wall the value remains 0 if not then 1

Li

And who I run backwards against a wall. And the command would also execute you if I just stood in front of the wall

Av

For back value, do the same with only another var and -1 ^ and if you want to query you can use data go Entity to get the walking distance data and memory and then look at the next tick if the player is at wall (top) and if Distance value greater than the previous one then execute command ais