Yaw / Pitch (Expression) — Skript

Addon: Skript · Category: Expression · Since: 2.0, 2.2-dev28 (vector yaw/pitch), 2.9.0 (entity changers)

Syntax

[the] (yaw|pitch) of %entities/locations/vectors%

Description

The yaw or pitch of a location or vector. A yaw of 0 or 360 represents the positive z direction. Adding a positive number to the yaw of a player will rotate it clockwise. A pitch of 90 represents the negative y direction, or downward facing. A pitch of -90 represents upward facing. Adding a positive number to the pitch will rotate the direction downwards. Only Paper 1.19+ users may directly change the yaw/pitch of players.

Examples

log "%player%: %location of player%, %player's yaw%, %player's pitch%" to "playerlocs.log"
set {_yaw} to yaw of player
set {_p} to pitch of target entity
set pitch of player to -90 # Makes the player look upwards, Paper 1.19+ only
add 180 to yaw of target of player # Makes the target look behind themselves

View source