i have this code: PHP: //save hotbar$hotbar = [];$inv = $player->getInventory();for($i = 0; $i < 7; $i++){ $hotbar[$i] = $inv->getHotbarSlotIndex($i);}//load hotbarfor($i = 0; $i < 7; $i++){ $inv->setHotbarSlotIndex($hotbar[$i], $i);}$inv->sendContents($player); but this doesnt work :/ what is wrong?
In creative, $inv->hotbar[] is always {0,1,2, ...,8} . Data is in $slots[]. Use getItem() and setItem().