Hey Guys! How can I calculate the distance in Blocks to the nearest player? I have already seen this, http://forums.pocketmine.net/threads/detecting-player-entity-distance.2477/ but it doesn't help me very much. Also, it should be only for players. Thanks!

Do you know Pythagoras' theorem? Search on the internet about that. It helps you the most. (In fact there is a function $vector->distance($otherVector))

Lol I didn't know such thing existed. I basically invented this theorem myself basing on the Pyth thm (our teacher repeatedly tells us to put capital P in our homework). Elaboration in my own words: Now we have a rectangle ABCD. ABCD is stretched upwards to achieve a cuboid ABCDHGFE. (G is directly above C) Square of AC is equal to square of AB plus square of BC. Now look at ACGE. (Draw your own diagram if you don't understand) ACGE is a rectangular plane. Square of AG is equal to square of AC plus square of CG. So therefore AG is equal to square root of (square of AB plus square of BC plus square or CG)! Done! Now we can convert AB, BC and CG into the X, Z and Y coordinate difference of the two players. The rest left to your own imagination.

Just making sure this is solved. This is distance in three-dimensional Euclidean space: That boils down to this example implementation: PHP: public function findDist(Position $a, Position $b){ return sqrt(pow($a->x - $b->x, 2) + pow($a->y - $b->y, 2) + pow($a->z - $b->z, 2));}