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
Comments 2
Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.
Quick Links:
π Issue Guidelines β π¬ Mojang Support β π§ Suggestions β π Minecraft Wiki
Resolving temporarily asΒ Awaiting Response. Is this still an issue in the latest version of the game (1.20.1)?
This ticket will reopen automatically when you reply.