use of org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.
the class RangedAttack method shouldStart.
@Override
public boolean shouldStart() {
if (myPet.getRangedDamage() <= 0) {
return false;
}
if (!entityMyPet.canMove()) {
return false;
}
if (!entityMyPet.hasTarget()) {
return false;
}
EntityLiving target = ((CraftLivingEntity) this.entityMyPet.getTarget()).getHandle();
double meleeDamage = myPet.getDamage();
if (meleeDamage > 0 && this.entityMyPet.f(target.locX, target.boundingBox.b, target.locZ) < 4) {
if (meleeDamage > rangedSkill.getDamage()) {
return false;
}
}
this.target = target;
return true;
}
use of org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.
the class Sprint method shouldStart.
@Override
public boolean shouldStart() {
if (!myPet.getSkills().isSkillActive(de.Keyle.MyPet.skill.skills.Sprint.class)) {
return false;
}
if (petEntity.getMyPet().getDamage() <= 0) {
return false;
}
if (!this.petEntity.hasTarget()) {
return false;
}
EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
if (!targetEntity.isAlive()) {
return false;
}
if (lastTarget == targetEntity) {
return false;
}
if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.f(targetEntity) >= 16) {
return false;
}
this.lastTarget = targetEntity;
return true;
}
use of org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.
the class Sprint method shouldStart.
@Override
public boolean shouldStart() {
if (!myPet.getSkills().isSkillActive(de.Keyle.MyPet.skill.skills.Sprint.class)) {
return false;
}
if (petEntity.getMyPet().getDamage() <= 0) {
return false;
}
if (!this.petEntity.hasTarget()) {
return false;
}
EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
if (!targetEntity.isAlive()) {
return false;
}
if (lastTarget == targetEntity) {
return false;
}
if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.h(targetEntity) >= 16) {
return false;
}
this.lastTarget = targetEntity;
return true;
}
use of org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.
the class MeleeAttack method shouldStart.
@Override
public boolean shouldStart() {
if (myPet.getDamage() <= 0) {
return false;
}
if (!this.petEntity.hasTarget()) {
return false;
}
EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
if (targetEntity instanceof EntityArmorStand) {
return false;
}
if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.f(targetEntity.locX, targetEntity.getBoundingBox().b, targetEntity.locZ) >= 20) {
return false;
}
this.targetEntity = targetEntity;
return true;
}
use of org.bukkit.craftbukkit.v1_18_R1.entity.CraftLivingEntity in project MyPet by xXKeyleXx.
the class Sprint method shouldStart.
@Override
public boolean shouldStart() {
if (!myPet.getSkills().isSkillActive(de.Keyle.MyPet.skill.skills.Sprint.class)) {
return false;
}
if (petEntity.getMyPet().getDamage() <= 0) {
return false;
}
if (!this.petEntity.hasTarget()) {
return false;
}
EntityLiving targetEntity = ((CraftLivingEntity) this.petEntity.getTarget()).getHandle();
if (!targetEntity.isAlive()) {
return false;
}
if (lastTarget == targetEntity) {
return false;
}
if (petEntity.getMyPet().getRangedDamage() > 0 && this.petEntity.h(targetEntity) >= 16) {
return false;
}
this.lastTarget = targetEntity;
return true;
}
Aggregations