I noticed that the return value of CustomEntity.Bone#getLocation is not the visual location of the position in the overworld. It seems that it returns the root of an ArmorStand instead of the actual Location of the point from the model in the world, like CustomEntity#getLocation. e.g. if your Mountpoint is at 0 0 0 in your model and you spawn your model on 0 100 0 the return value of CustomEntity.Bone#getLocation is 0 ≈97.525 0. Note that only the Y value is different.
If Y would be =98.025 it would make sense because the height of the armorstand, where the player sits onto, needs to be added. But it seems to be a magic like delta value which can be described like this: ≈(1.975 + 0.5)
. Due to the approximation you need to do some hacky stuff e.g. location.setY(Math.
floor
(location.getY() * 10e5) / 10e5)
to ensure equality between XYZ of two locations.
Is this an expected behavior? If so how is the delta value calculated?
Server version:
Paper version 1.20.6-138-master@906df69
ItemsAdder Version:
ItemsAdder version 4.0.1-alpha-test-3
ProtocolLib Version:
ProtocolLib version 5.3.0-SNAPSHOT-713
LoneLibs Version:
LoneLibs version 1.0.54