Student talks about carrying out a shooting on campus
TL;DR: you report this to campus safety (i.e., campus police) immediately.



Slightly longer response:

The proper way to handle this may vary from school to school. At my uni, which has unfortunately had to deal with school shootings, we are urged to report anything that even hints at such violence to the campus safety authorities (at my uni, campus police). There's a sound reason for this -- you may not know the whole picture. It's entirely possible that this student has made such threats in the past that you are unaware of, and that they've been monitored for an extended period of time. In such a case, this type of information may indicate to authorities that they need to take preventative action now. Even if they don't take action, they'll be able to document this and keep an eye out for worrisome patterns.

It's worth mentioning that there are those who would argue that this is premature -- or even a potential invasion of privacy on the part of that student -- with the thought that the student may not be showing further warning signs. This is not the right place for that discussion - if you feel that way, let's take it to the chat.

Ultimately, I would argue that you need to do what's best for the community here, not just for the victimized student. There may well be ways of protecting the victim's identity -- if so, feel free to do so -- but most administrators I've met would prioritize the safety of the community over the privacy of either the victim or the aggressor.