Lexepi

Untitled

Nov 2nd, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. @EventHandler
  2. public void eggLand(ProjectileHitEvent e) {
  3.  
  4.  
  5.  
  6. if (e.getEntity().getShooter() instanceof Player) {
  7.  
  8. if (e.getEntity() instanceof Egg) {
  9.  
  10.  
  11.  
  12. Player player = (Player) e.getEntity().getShooter();
  13.  
  14.  
  15. BlockIterator bi = new BlockIterator(e.getEntity().getWorld(), e.getEntity().getLocation().toVector(), e.getEntity().getVelocity().normalize(), 0.0D, 4);
  16.  
  17. Block hit = null;
  18.  
  19. while (bi.hasNext()) {
  20.  
  21. hit = bi.next();
  22.  
  23. hit.setType(Material.AIR);
  24.  
  25. break;
  26.  
  27.  
  28. }
  29. }
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment