Hello guys! Im trying to send the inventory of an chest to a player with addWindow() but its not working. What do i wrong? PHP: public function onOpen(Player $player){ $level = $player->getLevel(); $level->setBlock(new Vector3($player->x, $player->y + 3, $player->z), Block::get(54)); if($player->getLevel()->getTile(new Vector3($player->x, $player->y + 3, $player->z))){ $chest = $player->getLevel()->getTile(new Vector3($player->x, $player->y + 3, $player->z)); } $player->addWindow($chest->getInventory()); }
sadly adding a chest inventory is harder then this , here are some source(s) that use this function and can help you , https://github.com/Muqsit/ChestShop/blob/master/src/ChestShop/Main.php#L141 , all credits to Muqsit for making this plugin i didn't make it!