mojira.dev
MCPE-179128

Scripting: setRotation doesn't work for players

The bug

The setRotation function changes the direction an entity is looking. It works fine for other mobs, but does nothing when used on the player. No error or warning, it just does nothing.

How to reproduce

1. Download and open the attached world

2. Run /reload one or multiple times

Expected results
All entities, including the player, are turned to face straight south
Observed results
Other entities do, but the player doesn't

Relevant script

import {world} from "@minecraft/server"

let overworld = world.getDimension("overworld");
let players = world.getPlayers();
let entities = overworld.getEntities();
for (let player of players) {
   player.setRotation({"x":0, "y":0});
}
for (let entity of entities) {
   entity.setRotation({"x":0, "y":0});
}

Linked issues

Attachments

Comments 3

Also affects with android

tryashtar

(Unassigned)

1201260

Confirmed

Multiple

Script-API

1.20.70.25 Preview

Retrieved