Hi, i have a problem, im trying to do that every time player type /echest itll spawn a chest 2 block underneath him and itll set the saved contents, and when he closes the inventory, the chest will be set the the original block, anyways i just finished and i typed /echest, the chest spawned i even created a tile for it, but its not opening, any idea why?
Users Who Have Read This Thread (Total: 4) One of them was you, one was me. Do you expect that everyone here knows the answer? Those people might have just looked here because they need an answer as well. Please just wait for someone to get online and reply. Can you please show us your code? We cannot know what's wrong without even knowing what you did.
Have you checked with other PM forks? Just for testing?! I had the same problem with doors recently - it was simply that the client wasn't updating my view on official PM, so even though my doors were actually opening, I couldn't see them opening...
Im sorry, i will notice it next time and about the code: PHP: $this->id[$pl->getName()] = $pl->getLevel()->getBlockIdAt($pl->x, $pl->y - 2, $pl->z); $pl->getLevel()->setBlock(new Vector3($pl->x, $pl->y - 2, $pl->z), Block::get(Block::CHEST)); $nbt = new CompoundTag("", [ new ListTag("Items", []), new StringTag("id", Tile::CHEST), new IntTag("x", $pl->x), new IntTag("y", $pl->y - 2), new IntTag("z", $pl->z) ]); $nbt->Items->setTagType(NBT::TAG_Compound); $tile = Tile::createTile("Chest", $pl->getLevel()->getChunk($pl->x >> 4, $pl->z >> 4), $nbt); $chest = $pl->getLevel()->getTile(new Vector3($pl->x, $pl->y - 2, $pl->z)); $this->task[$pl->getName()] = 2; $pl->addWindow($chest->getInventory()); $chest->getInventory()->setContents($this->getEchestInventory($pl)); EDIT: Changed code type to PHP