Wilson snatched an abatement notice the officer served on him, screwed it up and told the officer to get a warrant.
As the officer headed down the driveway, he heard an air rifle being cocked, then fired.
Armed police were called to the scene and Wilson was subsequently arrested.
Wilson's lawyer, Kelly Ellis, said her client was just "a drunken fool making a lot of noise" and that he would grab an opportunity for home detention with both hands.
Judge Davis said if he had the impression Wilson aimed his gun at the noise control officer, then he would have gone to jail. Ms Ellis said there was no suggestion that the officer was targeted.
Judge Davis said the charges carried a maximum of three months in jail and Wilson would spend 35 minutes in prison if credits were given for his early guilty plea.
Wilson's behaviour in a residential area was foolish and the air-rifle shot could have hit someone, Judge Davis said.
He sentenced Wilson to four months' community detention and ordered that from Monday, Wilson observe a curfew from 7pm to 7am.
Judge Davis ordered that the air rifle be destroyed.