#Replace Block
1 messages · Page 1 of 1 (latest)
const direction = block.permutation.getState("facing_direction");
const myNewBlockPerm = BlockPermutation.resolve("block_id", {"facing_direction": direction});
block.setPermutation(myNewBlockPerm);
Assuming the facing_direction is the state name of the block's direction.
My block uses traits for the direction, I think it's minecraft:cardinal_direction
Then, just replace it with that