Set rotation
origins-powerful-powers:set_rotationentity action
Turns the entity to face a direction.
| Field | Type | Default | Description |
|---|---|---|---|
yaw | Float | none | Left/right angle in degrees, the same as the look_yaw attribute: 0 is south, 90 west, 180 north, -90 east. Left out: yaw is kept. |
pitch | Float | none | Up/down angle in degrees: -90 straight up, 90 straight down. Left out: pitch is kept. |
relative | Boolean | false | When true, yaw and pitch are added to the current angles. |
max_step | Float | none | The most each angle turns in one call, in degrees. Run it from origins:action_over_time to turn smoothly. Left out: it turns all the way at once. |
min_step | Float | 0 | A dead zone. When both angles are within this many degrees of the target, the call does nothing. |
- Players: the server sends a teleport that keeps the position and changes only the view. Movement is kept.
- Mobs: the head and body turn too. Their AI may turn them back on its next tick, so run the action every tick to hold a mob's facing.
- Other entities (armor stands, projectiles) get the new angles.
- Cost: for players, each call that changes the view sends a packet, so smooth turning sends one per call. Set
min_step(for example1) to stop calls once the view is close enough. This also avoids camera jitter.
Example: "Compass lock". While sneaking, your view turns north, 10 degrees per tick.
{
"type": "origins:action_over_time",
"interval": 1,
"condition": {
"type": "origins:sneaking"
},
"entity_action": {
"type": "origins-powerful-powers:set_rotation",
"yaw": 180,
"pitch": 0,
"max_step": 10,
"min_step": 1
}
}