Vector Math - JustKato/BukkitWiki GitHub Wiki
Calculating Vector Math
If you figure out vectors in space then you'll be able to manipulate even player movement! For the sake of the example and simplicity we are going to use a 2D plane, even though minecraft is 3D
We're going to use a player, a fireball, and a chicken for examples.

Let's add a grid overlay, so to make things easier with coordinates made-up, bottom left is 0,0 top right is 9,9

Now let's take the coordinates of each object and calculate the direction which is
B - A = DIR
B = FireBall
A = Player

Now that we figured the direction out which is (2, 2) let's normalize it! To normalize we use a formula Here's a great way to normalize them by hand but in our Vector class we have Vector.normalize() which is going to give us perfect results.
