I wanna make a commands, one of them will show someone else inventory, and other will show someone else enderchest. If you will not write a code, can you give me a tip? Thanks in advance. Sry if my english is bad
Hello, Here is the code to see the inventory of another player, make good use of it! PHP: public function onCommand(CommandSender $sender, Command $command, string $label, array $args) : bool{ if($command->getName() === "invsee") { if(!$sender instanceof Player || count($args) !== 1 || ($player = $this->getServer()->getPlayer($args[0])) === null) return false; $chest = Tile::createTile("Chest", $sender->getLevel(), new CompoundTag("", [new StringTag("id", "Chest"), new IntTag("x", round($sender->x)), new IntTag("y", round($sender->y) - 4), new IntTag("z", round($sender->z))])); $block = Block::get(54); $block->x = $chest->x; $block->y = $chest->y; $block->z = $chest->z; $block->level = $chest->getLevel(); $block->level->sendBlocks([$sender], [$block]); // Extract from the ChestShop plugin developed by Muqsit foreach($player->getInventory()->getContents() as $item) $chest->getInventory()->addItem($item); $sender->addWindow($chest->getInventory()); return true; }} Regarding to the code to see the inventory of player's Ender Chest, it is more complicated since it is necessary to assign the player to his EnderChest (with a Config for example...) and then use the same code by changing 2-3 stuff, I let you do! Keep me informed.