I wrote a plugin which sets blocks. Anything works, it sets grass-blocks, glas-blocks and so on, except chests. The Chests are sometimes invisible. And if I reload the map, all chest are invisible. I tried to set the chests with this code: PHP: $sender->getLevel()->setBlockIdAt($x, $y, $z, $id);$sender->getLevel()->setBlockDataAt($x, $y, $z, $Extraid); and with this code: PHP: $block = new Chest();$sender->getLevel()->setBlock(new Vector3($XKiste, $YKiste, $ZKiste), $block, true, true);
You have to initialize a chest tile object. MCPE wouldn't render the chest model until there is a tile entity at that position. Look at the the pocketmine\block\Chest:lace() method for how to place a chest. No, you are wrong. Please, don't accuse PocketMine as having bugs when it is behaving absolutely correctly and you are using it incorrectly.
No, I asked you to look at it, not to call it. https://github.com/PocketMine/PocketMine-MP/blob/master/src/pocketmine/block/Chest.php#L99 After setting the block to chest, you still have to create a tile for it.
Like this ? Code: $block = new Chest(); $sender->getLevel()->setBlock(new Vector3($XKiste, $YKiste, $ZKiste), $block, true, true); $nbt = new CompoundTag("", [ new ListTag("Items", []), new StringTag("id", Tile::CHEST), new IntTag("x", $XKiste), new IntTag("y", $YKiste), new IntTag("z", $ZKiste) ]); $nbt->Items->setTagType(NBT::TAG_Compound); $tile = Tile::createTile("Chest", $sender->getLevel()->getChunk($XKiste >> 4, $ZKiste >> 4), $nbt);