Like everything else, it all depends on the circumstances.
Excommunication is not a doctrinal matter - it is a Church judicial matter. As such, it is governed exclusively by Church ecclasistical law (typically Canon Law).
Depending on the circumstances (but clearly not in the case you describe), these Canons might apply:
A person is to be punished with a just penalty, who, at a public event or assembly, or in a published writing, or by otherwise using the means of social communication waddya know - Canon Law is catching up to Twitter], utters blasphemy, or gravely harms public morals, or rails at or excites hatred of or contempt for religion or the Church. [Canon 1369]
A person who joins an association which plots against the Church is to be punished with a just penalty‚ one who promotes or takes office in such an association is to be punished with an interdict. [Canon 1374]
Canon 1399 allows broad discretion in extreme cases not specifically addressed by other Canons:
Besides the cases prescribed in this or in other laws, the external violation of divine or canon law can be punished, and with a just penalty, only when the special gravity of the violation requires it and necessity demands that scandals be prevented or repaired.
Canon 1370 specifically deals with people who employ actual violence against Bishops (including the Pope), but does not apply to mere threats. As far as “hitting a priest,” this is best addressed by paragraph 3:
A person who uses physical force against a cleric or religious out of contempt for the faith, or the Church, or ecclesiastical authority or the ministry, is to be punished with a just penalty.
This hardly applies to a game of dodgeball, unless the person engages in the game with the intent to clandestinely inflict deliberate harm to the priest out of contempt for the priest’s holy Office. Even so, dodgeball (with its big, soft, rubber balls) is a poor choice of sport. Being a pitcher for an opposing baseball team, or an opponent on a hockey team, offers much greater opportunity.