-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAttackSmash.java
More file actions
43 lines (33 loc) · 1.16 KB
/
Copy pathAttackSmash.java
File metadata and controls
43 lines (33 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
package incineratorcow2.incineratorcow2;
import org.bukkit.Location;
import org.bukkit.entity.Cow;
import org.bukkit.entity.Player;
import org.bukkit.plugin.java.JavaPlugin;
import org.bukkit.scheduler.BukkitRunnable;
import org.bukkit.util.Vector;
public class AttackSmash extends IncineratorCow {
JavaPlugin _mainPlugin;
Cow _myCow;
public AttackSmash(JavaPlugin mainPlugin, Cow myCow) {
super(mainPlugin, myCow);
_mainPlugin = mainPlugin;
_myCow = myCow;
}
public void HoverPlayer(/*Player target*/) {
Player target;
target = GetRandomPlayer(50);
new BukkitRunnable() {
Location pursuedLoc;
Vector direction;
@Override
public void run() {
RemoveNearbyArea(cow, 2, 5, 5);
pursuedLoc = target.getLocation();
pursuedLoc.setY(pursuedLoc.getY() + 10);
direction = getDirection(cow.getLocation(), pursuedLoc);
cow.setVelocity(direction);
CheckCords(cow.getLocation(), 3, 0, pursuedLoc, true, false, true);
}
}.runTaskTimer(_mainPlugin, 0, 2);
}
}