how do I see the direction of the sign that the player has just placed and replace this sign when the sign does not exist anymore with the code: PHP: setBlock($pos, $block, $direct, $update); (I need for my plugin SignShop)
Thank you for your help! I solved with: PHP: $event->getBlock()->getDamage(); but when I put the sign with this code the server puts the sign in the direction 0 PHP: setBlock($pos, $block, $direct, $update); how can I fix this?
I pass the params: PHP: $pos->level->setBlock(new Vector3($pos->x, $pos->y, $pos->z), Block::get(Block::SIGN_POST), $get["direction"], true); $pos is a Position of sign; $get["direction"] is the direction of the sign created;
You can pass $pos directly; no need to make a new Vector3 object. Also, it should be Block::get($id, $damage) not Block::get($id), $damage. Also, you should leave $direct as false to make it faster.
thanks you for the help I have solved this problem with: PHP: $pos->level->setBlock($pos, Block::get(Block::SIGN_POST, $get["direction"]), false, true); I am very happy