A rotation: x is the pitch and y the yaw, in degrees.
Interface in @minecraft/server
A rotation: x is the pitch and y the yaw, in degrees.
import type { Vector2 } from '@minecraft/server';Example
Section titled “Example”import { world, type Vector2 } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const vector2: Vector2 = player.getRotation(); console.log(player.name, vector2.x);}import { world } from '@minecraft/server';
for (const player of world.getAllPlayers()) { const vector2 = player.getRotation(); console.log(player.name, vector2.x);}Properties
Section titled “Properties”x: number;y: number;Used by
Section titled “Used by”TeleportOptions.rotation, Entity.getRotation, Entity.setRotation, PlayerInputInfo.getMovementVector, Player.getRotation, InputInfo.getMovementVector, CameraFixedBoomOptions.viewOffset, CameraSetRotOptions.rotation, PlayerAimAssistSettings.viewAngle