Hey, How can i create a double chest, here is my previous attempt PHP: $tile = Tile::createTile(Tile::CHEST, $player->getLevel(), new CompoundTag("", [ new StringTag("id", Tile::CHEST), new StringTag("CustomName", 'test name ' . ucfirst($data['name']) . ' !'), new IntTag("x", (int)$player->x), new IntTag("y", (int)$player->y + 2), new IntTag("z", (int)$player->z), new IntTag('one', 1) ])); $tile2 = Tile::createTile(Tile::CHEST, $player->getLevel(), new CompoundTag("", [ new StringTag("id", Tile::CHEST), new StringTag("CustomName", 'test name ' . ucfirst($data['name']) . ' !'), new IntTag("x", (int)$player->x), new IntTag("y", (int)$player->y + 2), new IntTag("z", (int)$player->z), new IntTag('one', 1) ])); $tile->pairWith($tile2); $tile2->pairWith($tile); $block = Block::get(Block::CHEST, 0, $tile); $block2 = Block::get(Block::CHEST, 0, $tile2); $block->level->sendBlocks([$player], [$block, $block2]); $player->addWindow($tile->getInventory()); i get an error to Code: 22.01 23:20:11 [Server] Server thread/CRITICAL Error: "Call to a member function hasTag() on null" (EXCEPTION) in "src/pocketmine/tile/Chest" at line 131
I've fixed the error, i added + 1 to the x on one of the tiles, but now the inv only popups for like a second and its a normal chest inv.
You need to cause a bit of delay after sending the tiles and blocks to the client. You need to send the inventory after around 0.2 seconds. There should be an instantaneous method because in vanilla, this is 100% instantaneous. The more the player's ping, the lesser can be the delay.