Add entity eye height

This commit is contained in:
TheMode 2021-07-09 19:28:08 +02:00
parent 2efefe25b3
commit f829aea534

View File

@ -57,8 +57,11 @@ public final class RelativeVec {
* @return the location
*/
public @NotNull Vec from(@Nullable Entity entity) {
final var entityPosition = entity != null ? entity.getPosition() : Pos.ZERO;
return from(entityPosition);
if (entity != null) {
return from(entity.getPosition().add(0, entity.getEyeHeight(), 0));
} else {
return from(Pos.ZERO);
}
}
public @NotNull Vec fromSender(@Nullable CommandSender sender) {