Does anyone have a basic analogy on how to switch players items in there inventory? (The item in hand with a random one in the inventory) Everything I have been trying is duping the items.
PHP: /** @var Player $player */$inv = $player->getInventory();$rand = mt_rand(0, $inv->getSize());$item1 = $inv->getItem($rand);$item2 = $inv->getItemInHand();$inv->setItem($rand, $item2);$inv->setItemInHand($item1));