Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- final Chicken chicken = player.getWorld().spawn(player.getEyeLocation(), Chicken.class);
- final Vector direction = player.getLocation().getDirection();
- new BukkitRunnable() {
- @Override
- public void run() {
- chicken.setVelocity(direction);
- boolean explode = false;
- if (!chicken.getLocation().add(direction).getBlock().isEmpty()) {
- explode = true;
- }
- if (explode) {
- chicken.remove();
- cancel();
- }
- }.runTaskTimer(Main.getInstance(), 0, 1);
Advertisement
Add Comment
Please, Sign In to add comment