Detect Player Movement?

Started by jmods on

Topic category: Help with Minecraft modding (Java Edition)

Joined Jun 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Detect Player Movement?

I know it’s possible to detect player movement via velocity XYZ but is it possible to check the direction the player is moving and run a procedure?

 

For example:

Player Moves Forward > Run Procedure

Player Moves Backwards > Run Procedure 2

Player Moves Left > Run Procedure 3

Player Moves Right > Run Procedure 4

Player Moves Up > Run Procedure 5

Player Moves Down > Run Procedure 6

Joined Mar 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could combine checking…
Thu, 07/27/2023 - 10:13

You could combine checking the X Z velocities & the direction the player is facing

For example, if the player is facing North and their Z velocity is negative, they are moving forward.