This commit is contained in:
Minecon724 2022-01-29 16:19:04 +01:00
parent 5cdd686db9
commit 9838c4d90b
2 changed files with 20 additions and 16 deletions

View file

@ -35,6 +35,7 @@ public class Main extends JavaPlugin implements Listener {
boolean ai;
boolean headRotations;
boolean attack;
double chance;
double attackDamage;
double attackReach;
@ -84,20 +85,22 @@ public class Main extends JavaPlugin implements Listener {
}
}
}
}; //.runTaskTimer(this, config.getLong("hitDelay"), 0L);
new BukkitRunnable() {
@Override
public void run() {
for (Entity e : giants) {
List<Entity> passengers = e.getPassengers();
if (passengers.size() > 0) {
passengers.removeIf(n -> (n.getType() != EntityType.HUSK));
Location loc = passengers.get(0).getLocation();
e.setRotation(loc.getYaw(), loc.getPitch());
}.runTaskTimer(this, config.getLong("hitDelay"), 0L);
if (headRotations) {
new BukkitRunnable() {
@Override
public void run() {
for (Entity e : giants) {
List<Entity> passengers = e.getPassengers();
if (passengers.size() > 0) {
passengers.removeIf(n -> (n.getType() != EntityType.HUSK));
Location loc = passengers.get(0).getLocation();
e.setRotation(loc.getYaw(), loc.getPitch());
}
}
}
}
}.runTaskTimerAsynchronously(this, refreshDelay, 0L);
}.runTaskTimerAsynchronously(this, refreshDelay, 0L);
}
}
@EventHandler

View file

@ -12,9 +12,10 @@ attackReach: 2
# See https://hub.spigotmc.org/javadocs/spigot/org/bukkit/potion/PotionEffectType.html
# Set to [] to disable
effects:
- "JUMP:2"
# No need to change this
- "JUMP:1"
# Head rotations, disabling can slightly improve performance
headRotations: true
refreshDelay: 20
# No need to change this
expandUp: 0
attack: true