I want to make a protection plugin for a Minecraft server software and I want to work with Vector3. I want to check if a Vector3 is between 2 Positions (Vector3).
The Vector3 has got the values: x, y, and z. How can I check now if a Vector is between 2 others?
Vector3 pos1 = new Vector3(100, 10, 100);
Vector3 pos2 = new Vector3(10, 100, 43);
Vector3 vector3tocheck = new Vector3(60, 23, 1); // it should be between the 2 positions
public boolean isInTwoVectors(Vector3 pos1, Vector3 pos2, Vector3 vector3tocheck) {
// Here idk how to continue.
}
I expect the result if it is in the two positions or not.