-
Bug
-
Resolution: Unresolved
-
None
-
1.21.30.22 Preview, 1.21.30.21 Preview, 1.21.2 Hotfix, 1.21.51 Hotfix
-
Community Consensus
-
Multiple
The bug
The point returned by player.getBlockFromViewDirection does not match the actual block or face the player is looking at in some cases.
How to reproduce
1. Download and open the attached world. It has a script that displays red particles as a preview for block placement.
2. /tp @s -7.43 7.01 -40.60 61.48 28.40
Expected behavior
The red particles should be on top of the block, since that's where you're looking.
Observed behavior
They're on the side instead.
Notes
The relevant JS code is in scripts/entry.js. I've also attached it here for convenience.