Sheriff Lindsay Foulis launched his tirade against users of the games consoles yesterday, saying they had a negative impact on their lifestyles.
Over recent years there have been increasing concerns about the use of games consoles and the effect the games they play are having on their lives.
However, the sheriff has now expressed concern about the impact of using the computer games consoles upon gamers' attitude to getting a job.
Concern has also been raised in studies about violent video games, amid suggestions some users may commit crimes themselves.
Sheriff Foulis made his com-ments as he placed Ian Merchant, 17, on a scheme for young offenders and deferred sentence until July. Merchant had been convicted at Paisley Sheriff Court of racially abusing a police officer.
Sheriff Foulis said: "You have no experience of gainful employment, so aged 17 you have no qualifications and no employment experience. All you are able to do is deliver vile racist invective.
"But we are not finished there. The social work report says 'other than hanging out with my friends and playing Xbox' it doesn't appear he participates in any constructive recreational pursuits.
"He is a regular smoker of cannabis. Your propensity to smoke is a clear lifestyle choice. Your lack of self-control when drunk leaves a lot to be desired."
The court heard that Merchant had turned to smoking drugs after truanting from Perth Grammar School and failed to attend an employment programme.
He added: "There comes a point where the ball is at your feet. Where you are going is a complete waste of a young life. It is up to you what you make of it."
Merchant, who had previous convictions for racism, is the second offender this week to tell social workers his only interest was playing Xbox games, prompting the furious outburst from Sheriff Foulis.
Merchant, of Stanley, Perthshire, admitted shouting racist comments at PC Rory Miller at Perth Police HQ on 1 September.
Sheriff Foulis also this week berated another young man, who had admitted to assault and theft charges, for wasting his life playing on Xbox.
Jordan Mitchell, 20, was told to "wake up and smell the coffee" in the same court.
The sheriff said: "Other opportunities have been given to you and you really haven't bothered, so this is the last chance saloon you are in.
"The report on you doesn't give much ground for optimism. You are on jobseeker's allowance and your recreation is betting on horse racing and playing the Xbox."
He added: "It really is just a complete waste of a life."
By his fourth year at senior school Mitchell was frequently playing truant and was unsuccessful with an interview on the Youthbuild project.
He was given a six-month supervision order with a warning he may face prison if he does not comply with it.
In 2012, Steven McIntyre, 19, was convicted of murdering Jack Doyle, 17, in Greenock, Inverclyde.
The High Court in Glasgow heard how he went home and played as normal on his Xbox computer hours after the killing.