A 19-year-old who murdered his family and was plotting a school shooting wanted to be the worst mass school killer the UK has seen, a court has heard.