Deon McLaughlin allegedly broke in Wednesday morning and forced an overnight worker to search the school for money.
He is charged with Burglary in a School, Attempted Robbery and Aggravated Battery to a School Employee.
The state's attorney said he was on pre-trial release for other violent crimes at the time.
A judge granted the state's motion to detain him, citing the severity of the charges and his criminal history.
McLaughlin is due back in court on Jan. 5.