Discussion in 'Plugin Development' started by aArczi, Feb 29, 2016.
I would like to check if a player shot another player with a snow ball.
Use ProjectileHitEvent/EntityDamageEntityEvent. If the 'damager' is a snowball and the 'shooter' of the snowball is a player, do whatever you want.
EntityDamageByEntityEvent, see if someone was hit with a snowball.
Is there any example?
If you're asking for code, we do not provide that here.
If you want documentation:
Nono I just want a simple example how to call it, thats it.
Here is the wiki page how to create events:
Simply register your listener class, add the event method, and add the lines that check if the 'damager' is a snowball and if the 'shooter' is a player.
If you don't know how to get the shooter; cast the snowbal to a "Projectile" and use the "getShooter" method:
Separate names with a comma.