Set Rotation of an entity

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the community!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Stellar

Member
Jul 14, 2026
1
0
1
Skript 2.15.4
Minecraft 26.1.2.

I'm working with display blocks and I was trying to create a function that could set the rotation around an axis to a certain angle:

Code:
function SetRotation(e: entity, angle_x: number, angle_y: number, angle_z: number):
    rotate {_e} around vector(1,0,0) by {_angle_x} degrees
    rotate {_e} around vector(0,1,0) by {_angle_y} degrees
    rotate {_e} around vector(0,0,1) by {_angle_z} degrees

The expression
Code:
rotate {_e} around vector(0,0,1) by {_angle_...} degrees
is only increasing the rotation of the entity.
What I would like is an expression to SET the rotation
Something like:
Sass:
set rotation of {_e} around vector(0,0,1) to {_angle_...} degrees
But I can't find something alike anywhere...

Does someone know how to do it?

Thanks.