Search in sources :

Example 16 with EntityArmorStand

use of net.minecraft.server.v1_9_R2.EntityArmorStand 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;
}
Also used : EntityLiving(net.minecraft.server.v1_9_R2.EntityLiving) CraftLivingEntity(org.bukkit.craftbukkit.v1_9_R2.entity.CraftLivingEntity) EntityArmorStand(net.minecraft.server.v1_9_R2.EntityArmorStand)

Aggregations

MyPet (de.Keyle.MyPet.api.entity.MyPet)8 Behavior (de.Keyle.MyPet.skill.skills.Behavior)8 Player (org.bukkit.entity.Player)8 EntityArmorStand (net.minecraft.server.v1_10_R1.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_10_R1.EntityLiving)2 EntityArmorStand (net.minecraft.server.v1_11_R1.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_11_R1.EntityLiving)2 EntityArmorStand (net.minecraft.server.v1_12_R1.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_12_R1.EntityLiving)2 EntityArmorStand (net.minecraft.server.v1_8_R1.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_8_R1.EntityLiving)2 EntityArmorStand (net.minecraft.server.v1_8_R2.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_8_R2.EntityLiving)2 EntityArmorStand (net.minecraft.server.v1_8_R3.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_8_R3.EntityLiving)2 EntityArmorStand (net.minecraft.server.v1_9_R1.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_9_R1.EntityLiving)2 EntityArmorStand (net.minecraft.server.v1_9_R2.EntityArmorStand)2 EntityLiving (net.minecraft.server.v1_9_R2.EntityLiving)2 EntityMyPet (de.Keyle.MyPet.compat.v1_10_R1.entity.EntityMyPet)1