xeRicker

Untitled

Mar 18th, 2016
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. final Chicken chicken = player.getWorld().spawn(player.getEyeLocation(), Chicken.class);
  2. final Vector direction = player.getLocation().getDirection();
  3.  
  4. new BukkitRunnable() {
  5. @Override
  6. public void run() {
  7. chicken.setVelocity(direction);
  8.  
  9. boolean explode = false;
  10. if (!chicken.getLocation().add(direction).getBlock().isEmpty()) {
  11. explode = true;
  12. }
  13.  
  14. if (explode) {
  15. chicken.remove();
  16. cancel();
  17. }
  18. }.runTaskTimer(Main.getInstance(), 0, 1);
Advertisement
Add Comment
Please, Sign In to add comment