Check if entity velocity direction is heading above or below a location (point)

Discussion in 'Plugin Development' started by critikull, Aug 8, 2018.

Thread Status:
Not open for further replies.
  1. Offline

    critikull

    I am trying to write a function that can successfully determine whether an entities velocity/direction is heading above or below a specific point (Location). I've attached a 2D diagram to illustrate what I am trying to achieve.

    A more concrete example. If I choose a Location in the air and shoot an arrow at it. I'd like a bukkit task to be able to check whether the arrow is heading over or under the location.
     

    Attached Files:

  2. Offline

    Zombie_Striker

    @critikull
    For that, you will need to create a model for minceaft's gravity to calculate the drop-rate. My suggestion would be to track the velocity of a few arrows moving at different velocities over the course of a few seconds to find this rate.
     
Thread Status:
Not open for further replies.

Share This Page