Coordinate system

PHOTO EMBED

Fri Feb 26 2021 19:57:17 GMT+0000 (Coordinated Universal Time)

Saved by @surrealemily

@Mod(HifiMC.MOD_ID)
public class HifiMC {
    // ...

    @SubscribeEvent
    public void onRenderTickEvent(RenderTickEvent event) {
        if (event.phase != TickEvent.Phase.START) {
            return;
        }
        @SuppressWarnings("resource")
        ClientPlayerEntity player = Minecraft.getInstance().player;
        if (player != null) {
            Vector3d pos = player.getEyePosition(event.renderTickTime);
            float yaw = player.getRotationYawHead();
            LocationDataWebSocket.x = pos.x;
            LocationDataWebSocket.y = pos.y;
            LocationDataWebSocket.z = pos.z;
            LocationDataWebSocket.yaw = (-yaw + 180.0) % 360.0;
        }
    }
}
content_copyCOPY