Description
faceLocation in playerPlaceBlock (after doesn't have the property) and itemUseOn for the side that the place on is 0 instead of being negative slightly less than zero quantity so that the user can easily get the placeLocation by Vector.add(block.location, faceLocation).
face in playerPlaceBlock (after doesn't have the property) and blockFace in itemUseOn for z direction (south and north) placements are backwards.
Scenarios
In these examples, the player would be facing exactly in these directions with the other components of their view vector being 0. The facingLocation will be floored and it will be a beforeEvents.ItemUseOn as they seem to be the same.
West Block Place (x - 1):
Expected:
facingLocation: {x: 1, y: 0, z: 0}
blockFace: "East"
Observed:
facingLocation: {x: 1, y: 0, z: 0}
blockFace: "East"
{+}East Block Place (x + 1){+}:
Expected:
facingLocation: {x: -1, y: 0, z: 0}
blockFace: "West"
Observed:
facingLocation: {x: 0, y: 0, z: 0}
blockFace: "West"
South Block Place (z - 1):
Expected:
facingLocation: {x: 0, y: 0, z: 1}
blockFace: "North"
Observed:
facingLocation: {x: 0, y: 0, z: 1}
blockFace: "South"
{+}North Block Place (z + 1){+}:
Expected:
facingLocation: {x: 0, y: 0, z: -1}
blockFace: "North"
Observed:
facingLocation: {x: 0, y: 0, z: 0}
blockFace: "North"
{+}Up Block Place (y + 1){+}:
Expected:
facingLocation: {x: 0, y: -1, z: 0}
blockFace: "Down"
Observed:
facingLocation: {x: 0, y: 0, z: 0}
blockFace: "Down"
Down Block Place (y - 1):
Expected:
facingLocation: {x: 0, y: 1, z: 0}
blockFace: "Up"
Observed:
facingLocation: {x: 0, y: 1, z: 0}
blockFace: "Up"
Conclusion
facingLocation doesn't go negative and blockFace in the z direction is backwards.
facingLocation for the positive placements should be slightly less than 0 quantity so that flooring works correctly and users don't have to do extra conversions to get the block the player placed at. (mostly to check if the player can place it based on position then if not cancel the event).
Attachments
Comments 4
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response.
Could you please attach an example addon showcasing the issue?
This ticket will automatically reopen when you reply.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki
Pack as requested
only works for 1.19.30
sub minor updates don't matter. it will work as long as the current beta version for release is 1.6.0-beta
reference for each direction: https://learn.microsoft.com/en-us/minecraft/creator/scriptapi/minecraft/server/direction
The docs could be wrong for why blockFace is backwards in the z direction but idk
Edit:
cleaned up the code so it better represents the cases and doesn't need content log on
Pack has the same code