@Override public void tick() { this.petEntity.getControllerLook().a(this.targetPlayer.locX, this.targetPlayer.locY + this.targetPlayer.getHeadHeight(), this.targetPlayer.locZ, 10.0F, this.petEntity.x()); this.ticksUntilStopLooking -= 1; } }
@Override public void tick() { this.ticksUntilStopLookingAround--; this.petEntity.getControllerLook().a(this.petEntity.locX + this.directionX, this.petEntity.locY + this.petEntity.getHeadHeight(), this.petEntity.locZ + this.directionZ, 10.0F, this.petEntity.x()); } }
@Override public void tick() { this.petEntity.getControllerLook().a(targetEntity, 30.0F, 30.0F); if (--this.timeUntilNextNavigationUpdate <= 0) { this.timeUntilNextNavigationUpdate = (4 + this.petEntity.getRandom().nextInt(7)); this.petEntity.getPetNavigation().navigateTo((LivingEntity) targetEntity.getBukkitEntity()); } if (this.petEntity.f(targetEntity.locX, targetEntity.boundingBox.b, targetEntity.locZ) - (targetEntity.length * (2. / 3.)) <= this.range && this.ticksUntilNextHitLeft-- <= 0) { if (this.petEntity.getEntitySenses().canSee(targetEntity)) { this.ticksUntilNextHitLeft = ticksUntilNextHit; if (this.petEntity instanceof MyPetEquipment) { if (((MyPetEquipment) this.petEntity).getEquipment(EquipmentSlot.MainHand) != null) { this.petEntity.ba(); // -> swingItem() } } this.petEntity.attack(targetEntity); } } } }
getControllerLook().a(); // look
@Override public void tick() { double distanceToTarget = this.entityMyPet.f(this.target.locX, this.target.boundingBox.b, this.target.locZ); boolean canSee = this.entityMyPet.getEntitySenses().canSee(this.target); if (canSee) { this.lastSeenTimer++; } else { this.lastSeenTimer = 0; } if ((distanceToTarget <= this.range) && (this.lastSeenTimer >= 20)) { this.entityMyPet.getPetNavigation().getParameters().removeSpeedModifier("RangedAttack"); this.entityMyPet.getPetNavigation().stop(); } else { this.entityMyPet.getPetNavigation().getParameters().addSpeedModifier("RangedAttack", walkSpeedModifier); this.entityMyPet.getPetNavigation().navigateTo(this.target.getBukkitEntity().getLocation()); } this.entityMyPet.getControllerLook().a(this.target, 30.0F, 30.0F); if (--this.shootTimer <= 0) { if (distanceToTarget < this.range && canSee) { shootProjectile(this.target, (float) myPet.getRangedDamage(), getProjectile()); Ranged rangedSkill = myPet.getSkills().get(Ranged.class); this.shootTimer = rangedSkill.getRateOfFire().getValue(); } } }
this.petEntity.getControllerLook().a(owner, 10.0F, (float) this.petEntity.x());