Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- new BukkitRunnable() {
- double t = 0;
- Location loc = player.getLocation();
- Vector direction = loc.getDirection().normalize();
- public void run() {
- t = t + 1.5;
- double x = direction.getX() * t;
- double y = direction.getY() * t + 1.5;
- double z = direction.getZ() * t;
- loc.add(x, y, z);
- ParticleEffect.SPELL_WITCH.send(Bukkit.getOnlinePlayers(), loc, 0, 0, 0, 0, 10);
- for (Entity e : loc.getChunk().getEntities()) {
- if (e instanceof LivingEntity) {
- if (e instanceof Player) {
- Player target = (Player) e;
- if (e.getLocation().distance(loc) < 1.5 && target.getDisplayName() != player.getDisplayName()) {
- if (!UnionHook.areInSameGroup(target, player)) {
- ((LivingEntity) e).damage(modifier.getDamage(), player);
- this.cancel();
- }
- }
- } else {
- if (e.getLocation().distance(loc) < 1.5) {
- ((LivingEntity) e).damage(modifier.getDamage(), player);
- this.cancel();
- }
- }
- }
- }
- if (t > 50 || (loc.getBlock().getType() != Material.AIR && loc.getBlock().getType() != Material.SNOW && loc.getBlock().getType() != Material.LONG_GRASS)) {
- this.cancel();
- }
- loc.subtract(x, y, z);
- }
- }.runTaskTimer(Main.getInstance(), 0, 1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement