Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @EventHandler
- public void eggLand(ProjectileHitEvent e) {
- if (e.getEntity().getShooter() instanceof Player) {
- if (e.getEntity() instanceof Egg) {
- Player player = (Player) e.getEntity().getShooter();
- BlockIterator bi = new BlockIterator(e.getEntity().getWorld(), e.getEntity().getLocation().toVector(), e.getEntity().getVelocity().normalize(), 0.0D, 4);
- Block hit = null;
- while (bi.hasNext()) {
- hit = bi.next();
- hit.setType(Material.AIR);
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment