Police obtained his cellphone records and found he had sent and received 4800 text messages between June 1 and August 15, a large proportion of which were related to drug offers.
He would send a text, often in school hours, asking if a student was looking for drugs. His customers would text back saying how much they wanted and setting a place and time to meet.
Phone record analysis showed many of the messages were sent from the school boundary. Students would meet him before school, at lunchtime or after the final bell.
When police searched Clements' home in November they found a jar of cannabis seeds and, hidden in his underpants, a glass P pipe and two lighters. His initial explanation for the 4800 texts was that his ex-girlfriend, who he had split up with 10 days earlier, had sent them.
In a letter addressed to the court, Kerikeri High's acting principal said Clements' actions were unconscionable and took advantage of a number of naive and easily led students. He posed a significant threat to young people at the school.
Judge McDonald said: "To say Kerikeri High School is greatly upset and bitterly disappointed at your actions would be a major understatement."
Clements' lawyer, Doug Blaikie, said he had to wonder why magic mushrooms were grouped with class A drugs such as P and heroin when they are non-addictive and far less harmful.
They grew prolifically around Kerikeri, where Clements picked them himself, and he only started selling them "after a certain amount of encouragement".
Mr Blaikie accepted his client's sentence had to reflect the fact that he was dealing to under-18s, but that had to be tempered with the fact that Clements himself was only 19 at the time.
"This is a young man who has made some inappropriate choices and who at the time of his offending was in the grips of a methamphetamine addiction."
There was no suggestion he had tried to deal in P, Mr Blaikie said.
Judge McDonald gave Clements a discount for pleading guilty but none for remorse, saying he believed his only remorse was for himself. He was sentenced to two years and 11 months in jail on the drugs charges and one month on the driving charges.