Search in sources :

Example 1 with IAnimatedEntity

use of thehippomaster.AnimationAPI.IAnimatedEntity in project ArsMagica2 by Mithion.

the class AIShakeHead method shouldAnimate.

public boolean shouldAnimate() {
    EntityLiving living = getEntity();
    if (living.getAttackTarget() == null)
        return false;
    if (living.getHealth() > living.getMaxHealth() - 4)
        return false;
    IAnimatedEntity entity = (IAnimatedEntity) living;
    return entity.getAnimID() == 0 && living.getRNG().nextInt(30) == 0;
}
Also used : EntityLiving(net.minecraft.entity.EntityLiving) IAnimatedEntity(thehippomaster.AnimationAPI.IAnimatedEntity)

Aggregations

EntityLiving (net.minecraft.entity.EntityLiving)1 IAnimatedEntity (thehippomaster.AnimationAPI.IAnimatedEntity)1