Skip to content

Instantly share code, notes, and snippets.

@JOPHESTUS
Created December 1, 2013 03:13
Show Gist options
  • Save JOPHESTUS/7728082 to your computer and use it in GitHub Desktop.
Save JOPHESTUS/7728082 to your computer and use it in GitHub Desktop.
@EventHandler
public void onSnowBallHitBecuaseGomeowIsABabe(EntityDamageByEntityEvent event){
Projectile thrown = (Projectile) event.getEntity();
Player thrower = (Player) thrown.getShooter();
if (event.getDamager() instanceof Snowball){
List <Entity> entitylist = thrown.getNearbyEntities(1, 1, 1);
for (Entity p : entitylist){
if (p instanceof Player){
Player play = (Player) p;
tag(thrower, play, event);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment