@Zayd you could try to pass 1 as third argument, which is the parameter of the item count. So instead of: 310, 0, 0 I'd say: 310, 0, 1
Done, still didn't work... I don't know why You also didn't have to explain third argument, but I appreciate it (I saw the first comment XD)
Make sure to import Enchantment and Item(from the item directory, not entity directory). Change the 3rd parameter from 0 to 1 because the third parameter represents the item count. Also, enchantments always default to 1, no need to set it. EDIT: You could also try using $player->setArmorContents([helm, chestplate, leggings, boots]);