Well, one error i can see is that you used player->getInventory() instead of $player->getInventory() Also: WTF just replace all those spam lines with one line where the 1 at the end is the item count
PHP: $enchantment = Enchantment::getEnchantment(10);$enchantment->setLevel(1);$helmet = Item::get(310, 0, 1);$chestplate = Item::get(311, 0, 1);$leggings = Item::get(312, 0, 1);$boots = Item::get(313, 0, 1);$inv = $player->getInventory();$helmet->addEnchantment($enchantment);$chestplate->addEnchantment($enchantment);$leggings->addEnchantment($enchantment);$boots->addEnchantment($enchantment);$inv->addItem($helmet);$inv->addItem($chestplate);$inv->addItem($leggings);$inv->addItem($boots); what is wrong here? Please help. It's urgent...
add to uses: use pocketmine\item\Item; use pocketmine\item\enchantment\Enchantment; use pocketmine\item\enchantment\EnchantmentList; use pocketmine\item\enchantment\EnchantmentEntry;
I already had use pocketmine/item/item so I removed one of them as it was causing a crash. No error in console now, just doesn't load their armor onto the player
The armor should be sent to the Player's inventory. Are you trying to make it equip the armor automatically?
since you already get it, then there no need to be exact we just need to be able to understand this is not a forum for code copiers so we please dont be too bothered