PHP: /** @var $sign Sign *//** @var $player Player *//** @var $block Block */$block = $sign->getLevel()->getBlock($sign->add($player->getDirection()->normalize())); Behind, relative to what?
I think you could try getting the meta of the sign, as it should be different for the direction it is facing. Then make a switch case for those sides and make it $z + 1 or $x - 1 for example.
https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/block/WallSign.php#L35 You can use the code from here
The link there is your example? Just replace $this inside there with $block, a Block object Note: dont just copy the whole function and expect it to work, copy only what you need
PHP: #$b need to be instanceof Block$faces = [ 2 => 3, 3 => 2, 4 => 5, 5 => 4, ]; if(isset($faces[$b->getDamage()])){ if($b->getSide($faces[$b->getDamage()])->getId() === $someBlockID){$this->owner->getServer()->getDefaultLevel()->setBlock($b, Block::get(1,0));}}
PHP: #$b need to be instanceof Block$faces = [ 2 => 3, 3 => 2, 4 => 5, 5 => 4, ]; if(isset($faces[$b->getDamage()])){ if($b->getSide($faces[$b->getDamage()])->getId() === $someBlockID){$this->owner->getServer()->getDefaultLevel()->setBlock($b->getSide($faces[$b->getDamage()]), Block::get(1,0));}}