Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-179128

Scripting: setRotation doesn't work for players

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.20.70.25 Preview
    • Confirmed
    • Multiple
    • 1201260

      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});
      }
      

            tryashtar [Mod] tryashtar
            Votes:
            3 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: