Andersons pies have an excellent reputation in Taranaki but not being able to buy one is not an adequate reason to smash up a money machine, a court has heard. (File photo)

Drunk and hankering for a pie, a 26-year-old builder became enraged and smashed up a money machine when it wouldn't give him the cash to buy one.

Just after midnight on May 31, Hayden Caskey, 26, decided to he wanted a pie and attempted to withdraw some cash from an ATM in Hāwera to purchase one, police prosecutor sergeant Steve Hickey said.

Caskey was heavily intoxicated at the time.

When the ATM "ate" his card and requested he contact the bank, Caskey became enraged and began punching the machine with his fists. He then smashed a glass bottle against it.

READ MORE:

* Pies thrown in dairy after customer's eftpos card declined

* Rat breaches bank ATM in India, dines out on $27,500 worth of cash

Caskey completely destroyed the perspex used to house the ATM computer and also damaged the ATM itself, leaving it inoperable.

He then left the scene. When he was located later by police he told them he damaged the machine because it ate his bankcard and he needed the card to buy a pie.

"It was understandable but not an excuse," Hickey said.

Caskey pleaded guilty in Hāwera DIstrict Court on Tuesday to one charge of intentional damage.

Lawyer Nathan Bourke said his client acknowledged his behaviour was due to being drunk.

"I can attest that the local Andersons Pies are delicious but it does not provide an excuse, and he acknowledges that," said Bourke.

Caskey was fully employed and could pay a fine off at $50 a week, he said.

"You effectively lost it with a money machine when it wouldn't give your card back," Judge Lynne Harrison told Caskey.

​"In the circumstances this will be a very expensive pie for you."

She convicted Caskey and fined him $500 and $130 court costs, to be repaid at $50 a week.

No reparation amount had been provided to the police so it was not ordered.