I don't know what you are saying with "Spawn ItemStack", because ItemStacks can't "Spawn".
If you have a ItemStack and want this item to Spawn in world right above players head, use ItemEntity (search how mobs drops its inventory and copy the code there).
But if you want to put a specific ItemStack in player armor head position inventory, its simple: playerEntity.armorinventory.set(slot, itemstack) // don't remember if player head slot is 0 or 3, try it
Always do these things SERVER side.