This commit is contained in:
paulevsGitch 2020-10-25 21:54:31 +03:00
parent 886be5bbc6
commit e2192b2c4b

View file

@ -143,9 +143,14 @@ public class EntityDragonfly extends AnimalEntity implements Flutterer {
public void start() { public void start() {
Vec3d vec3d = this.getRandomLocation(); Vec3d vec3d = this.getRandomLocation();
if (vec3d != null) { if (vec3d != null) {
BlockPos pos = new BlockPos(vec3d);
if (!pos.equals(EntityDragonfly.this.getBlockPos())) {
Path path = EntityDragonfly.this.navigation.findPathTo(new BlockPos(vec3d), 1); Path path = EntityDragonfly.this.navigation.findPathTo(new BlockPos(vec3d), 1);
if (path != null) {
EntityDragonfly.this.navigation.startMovingAlong(path, 1.0D); EntityDragonfly.this.navigation.startMovingAlong(path, 1.0D);
} }
}
}
super.start(); super.start();
} }