Mojira Archive
MCPE-165527

Bedrock Scripting API "viewDirection" related methods not working

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

Incomplete

Aviv Keller

2022-12-27, 09:53 PM

2023-10-12, 12:22 PM

2023-10-12, 12:22 PM

1

1

Unconfirmed

1.19.51

-