mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
Add entity eye height
This commit is contained in:
parent
2efefe25b3
commit
f829aea534
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user