[Minor] The Entity Position operator does not give exact position.
Mach12 opened this issue ยท 14 comments
At least for player entities, it gives head position instead.
While this does facilitate raycasting, the position of a player is at its feet, and thus obtaining an exact height relatively to a Player is harder.
This might be just misbehavior or simply intended, but in both cases it is not stated in the in-game doc and got me to misprogram quite a few spells.
If so, it should be mentioned in the in-game doc. Calling the player's eye position -too late to edit-
@yrsegal you're incorrect. all entities are stored serverside and in NBT using their feet position.
in 1.7 and below client players (and only client players) were stored from eye position, but that bug has been fixed in 1.8+
I've gotten debug info showing the player y position as in the head in 1.9. That may have changed since the start, but that's what I remember.
And again my point still stands: if the way the Position operator works changes depending on entity type, this is misleading and definitely not documented in the mod.
It apparently does now, and it is misleading, I agree. From psi:
Vector3 vec = Vector3.fromEntity(e);
if(e instanceof EntityPlayer) {
vec.add(0.0D, (double)e.getEyeHeight(), 0.0D);
}
return vec;