Mojira Archive
MCPE-182546

faceLocation in BlockCustomComponent.onPlayerInteract doesn't return to actual faceLocation

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));
{{        }}}
    });
});

Incomplete

Unknown

2024-06-11, 05:37 AM

2024-12-03, 12:34 PM

2024-12-03, 12:34 PM

0

3

Unconfirmed

1.21.10.22 Preview, 1.20.81 Hotfix

-