#hello, how to find a rotation of a block in js ?

1 messages · Page 1 of 1 (latest)

half lake
#

pls

#

world.beforeEvents.playerBreakBlock.subscribe(ev => {
    if (!ev.player.hasTag("Staff")) {
        if (ev.block.type.id === 'minecraft:lectern') {

            let x1 = ev.block.location.x;
            let y1 = ev.block.location.y;
            let z1 = ev.block.location.z;

     
       world.getDimension("overworld").runCommand(`fill ${x1} ${y1} ${z1} ${x1} ${y1} ${z1} lectern ["minecraft:cardinal_direction"="east"]`);



            world.getDimension("overworld").runCommand(`fill ${x1} ${y1} ${z1} ${x1} ${y1} ${z1} lectern ["minecraft:cardinal_direction"="west"]`);



            world.getDimension("overworld").runCommand(`fill ${x1} ${y1} ${z1} ${x1} ${y1} ${z1} lectern ["minecraft:cardinal_direction"="south"]`);


            world.getDimension("overworld").runCommand(`fill ${x1} ${y1} ${z1} ${x1} ${y1} ${z1} lectern ["minecraft:cardinal_direction"="north"]`);


        }

    }
});
#

to replace lectern at its origin rotation and position

plucky pike