Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. new BukkitRunnable() {
  2. double t = 0;
  3. Location loc = player.getLocation();
  4. Vector direction = loc.getDirection().normalize();
  5.  
  6. public void run() {
  7. t = t + 1.5;
  8. double x = direction.getX() * t;
  9. double y = direction.getY() * t + 1.5;
  10. double z = direction.getZ() * t;
  11. loc.add(x, y, z);
  12. ParticleEffect.SPELL_WITCH.send(Bukkit.getOnlinePlayers(), loc, 0, 0, 0, 0, 10);
  13. for (Entity e : loc.getChunk().getEntities()) {
  14. if (e instanceof LivingEntity) {
  15. if (e instanceof Player) {
  16. Player target = (Player) e;
  17. if (e.getLocation().distance(loc) < 1.5 && target.getDisplayName() != player.getDisplayName()) {
  18. if (!UnionHook.areInSameGroup(target, player)) {
  19. ((LivingEntity) e).damage(modifier.getDamage(), player);
  20. this.cancel();
  21. }
  22. }
  23. } else {
  24. if (e.getLocation().distance(loc) < 1.5) {
  25. ((LivingEntity) e).damage(modifier.getDamage(), player);
  26. this.cancel();
  27. }
  28. }
  29. }
  30. }
  31. if (t > 50 || (loc.getBlock().getType() != Material.AIR && loc.getBlock().getType() != Material.SNOW && loc.getBlock().getType() != Material.LONG_GRASS)) {
  32. this.cancel();
  33. }
  34. loc.subtract(x, y, z);
  35. }
  36. }.runTaskTimer(Main.getInstance(), 0, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement