How do I place a sign with text using setBlock()? i tried PHP: $level = $p->getLevel();$sign = Block::get(Block::SIGN_POST);$level->setBlock(new Vector3(0,105,0), $sign); $block = $level->getBlockAt(10,105,0); $tile = $level->getTile($block); if($tile instanceof Sign){ $tile->setText("line1,","2","3","4"); } it was placing the sign but it wasn't setting the lines
The coordinates you set the block and get the tile are not the same You need to create the tile yourself, setblock doesnt create the tile for you
PHP: /** @var Level $level *//** @var Position $pos */$tile = Tile::createTile(Tile::SIGN, $level, Sign::createNBT($pos));
PHP: $x = $player->x; $y = $player->y; $z = $player->z; $sign = Block::get(Block::SIGN_POST); $tile = Tile::createTile(Tile::SIGN, $level, Sign::createNBT(new Vector3($x,$y,$z))); $level->addTile($tile); $level->setBlock(new Vector3($x,$y,$z), $sign); $block = $level->getBlockAt((int)$x,(int)$y,(int)$z); $tile = $level->getTile($block); if($tile instanceof Sign){ $tile->setText(:"Hellow"); $tile->setLine(1,"Sup dawg"); }