A 16-year-old boy was allegedly found with a knife and an illegal gun after he came under scrutiny from police for posting threats of extremist violence online.