The faceLocation is a location relative to the bottom north-west corner of the block, which is (0,0,0) and (1,1,1) on the top south-east of the block. In BlockCustomComponent.onPlayerInteract it returns to an actual world coordinate where the player is interacted rather than a faceLocation like from other world events (e.g., from PlayerInteractWithBlock, itemUseOn)
//This return to an actual faceLocation of the block
world.afterEvents.playerInteractWithBlock.subscribe(e => {
console.warn(JSON.stringify(e.faceLocation));
});//This return to world coordinate where the player is interacted with
world.beforeEvents.worldInitialize.subscribe(e => {
e.blockTypeRegistry.registerCustomComponent('custom:component', {
onPlayerInteract(e) {
console.warn(JSON.stringify(e.faceLocation));
{{ }}} });
});
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
We do not have enough information to reproduce this issue.
Please include the following information to help us understand your problem:
Please also attach any needed commands, add-ons/behavior packs, data packs, resource packs, screenshots, videos, or worlds needed to help reproduce this issue.
Refer to the Bug Tracker Guidelines for more information about how to write helpful bug reports. Bug reports with insufficient information may be closed as Incomplete.
This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki