Stuart Wellesley Parkinson, 45, was sentenced on Thursday in the Christchurch District Court on three charges under the Animal Welfare Act.
As well as the community work order, he was banned from owning any more cattle.
Ministry for Primary Industries animal welfare manager Peter Hyde said inspectors and a veterinarian found at least 20 dead cows on Parkinson's property when they went for an inspection following a complaint in August 2022.
They also had to euthanise about eight cows and calves.
"These animals were starving, evident from their grinding of teeth, circling when walking and in some cases, their inability to stand up on their feet. These animals needed immediate veterinary attention," Hyde said.
"People in charge of animals are responsible for their wellbeing at all times - including providing quality feed and water. Mr Parkinson failed to live up to these responsibilities."
In total, there were about 70 cows and 20 calves at the farm, Hyde said.
"There was a lack of grass cover, water pooling, muddy paddocks, and few dry areas for the animals to lie down. The herd was calving, and their average weights were examined and found to be below the Code of Welfare for Dairy Cattle.
"The animal welfare problems must have been obvious to Mr Parkinson. At no point did he seek veterinary attention.
"The veterinarian diagnosed the herd as suffering from severe malnutrition, caused by failing to provide sufficient feed. Mr Parkinson had fed these animals on grass only during that winter, stating that he had been trying to sell the cattle and that he had run out of feed."
Hyde encouraged anyone who was aware of animal ill-treatment or cruelty to report it to the MPI animal welfare complaints line, on 0800 00 83 33.