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

Bedrock Scripting API "viewDirection" related methods not working

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.19.51
    • None
    • Unconfirmed
    • Windows

      All methods and properties related to view direction of entities in the Minecraft Bedrock Scripting API return undefined.

      myEntity.viewDirection
      myEntity.getBlockFromViewDirection()
      myEntity.getEntitiesFromViewDirection()
      

      To reproduce this issue, add the following code to a GameTest:

      let simulatedPlayer = test.spawnSimulatedPlayer(new BlockLocation(0, 0, 0));
      world.say(`The view direction is: ${simulatedPlayer.viewDirection}`) // undefined
      
      /* This issue does not only happen to SimulatedPlayers, but also other entities.
      let player = world.getAllPlayers()[0]
      world.say(`The view direction is: ${player.viewDirection}`) // also undefined
      

            Awesomemaker Aviv Keller
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: