mojira.dev
MC-293616

First value of local coordinates calculates z-coordinate inconsistently

When using local coordinates in commands (^a ^b ^c), the first value (a) describes the offset to the left of the entity. Since entities cannot tilt sideways (i.e. they only have pitch and yaw, no roll), offsetting the first local coordinate on its own should always yield a position on the same height as the entity.

For example, if the player is stood precisely at the coordinates 0 0 0 and enters the command

/setblock ^1 ^ ^ dirt

depending on the player’s yaw (first rotational coordinate), Dirt should be placed at one of the coordinates {(-1 0 -1), (-1 0 0), (-1 0 1), (0 0 -1), (0 0 1), (1 0 -1), (1 0 0), (1 0 1)}.

However, depending on the player's pitch (second rotational coordinate), it can get placed at the same x/z coordinates at y=-1, which mathematically should not happen.

I could only observe this behaviour when standing on a top surface (i.e. when y is an integer). I suppose it is a rounding issue

Attachments

Comments 1

TheMightyTorch

(Unassigned)

Confirmed

Platform

Normal

Commands

1.21.4, 1.21.5 Pre-Release 1, 1.21.5 Pre-release 2

Retrieved