Search in sources :

Example 11 with EntityAIWanderAvoidWater

use of net.minecraft.entity.ai.EntityAIWanderAvoidWater in project Almura by AlmuraDev.

the class MixinEntityPig method initEntityAI.

/**
 * @author Dockter
 * Purpose: overwrite the AT init method to customize the temptations list.
 */
@Overwrite
protected void initEntityAI() {
    final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(Items.CARROT, Items.POTATO, Items.BEETROOT);
    Item soyBeanItem = GameRegistry.makeItemStack("almura:food/food/soybean", 0, 1, null).getItem();
    Item cornItem = GameRegistry.makeItemStack("almura:food/food/corn", 0, 1, null).getItem();
    if (soyBeanItem != ItemStack.EMPTY.getItem())
        TEMPTATION_ITEMS.add(soyBeanItem);
    if (cornItem != ItemStack.EMPTY.getItem())
        TEMPTATION_ITEMS.add(cornItem);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 1.25D));
    this.tasks.addTask(3, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(4, new EntityAITempt(this, 1.2D, Items.CARROT_ON_A_STICK, false));
    this.tasks.addTask(4, new EntityAITempt(this, 1.2D, false, TEMPTATION_ITEMS));
    this.tasks.addTask(5, new EntityAIFollowParent(this, 1.1D));
    this.tasks.addTask(6, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(8, new EntityAILookIdle(this));
}
Also used : Item(net.minecraft.item.Item) EntityAIWatchClosest(net.minecraft.entity.ai.EntityAIWatchClosest) EntityAIFollowParent(net.minecraft.entity.ai.EntityAIFollowParent) EntityAISwimming(net.minecraft.entity.ai.EntityAISwimming) EntityAITempt(net.minecraft.entity.ai.EntityAITempt) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityAIMate(net.minecraft.entity.ai.EntityAIMate) EntityAILookIdle(net.minecraft.entity.ai.EntityAILookIdle) EntityAIPanic(net.minecraft.entity.ai.EntityAIPanic) EntityAIWanderAvoidWater(net.minecraft.entity.ai.EntityAIWanderAvoidWater) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Example 12 with EntityAIWanderAvoidWater

use of net.minecraft.entity.ai.EntityAIWanderAvoidWater in project Almura by AlmuraDev.

the class MixinEntityCow method initEntityAI.

/**
 * @author Dockter
 * Purpose: overwrite the AT init method to customize the temptations list.
 */
@Overwrite
protected void initEntityAI() {
    final Set<Item> TEMPTATION_ITEMS = Sets.newHashSet(Items.WHEAT);
    Item soyBeanItem = GameRegistry.makeItemStack("almura:food/food/soybean", 0, 1, null).getItem();
    Item cornItem = GameRegistry.makeItemStack("almura:food/food/corn", 0, 1, null).getItem();
    Item alfalfaItem = GameRegistry.makeItemStack("almura:normal/crop/alfalfa_item", 0, 1, null).getItem();
    if (soyBeanItem != ItemStack.EMPTY.getItem())
        TEMPTATION_ITEMS.add(soyBeanItem);
    if (cornItem != ItemStack.EMPTY.getItem())
        TEMPTATION_ITEMS.add(cornItem);
    if (alfalfaItem != ItemStack.EMPTY.getItem())
        TEMPTATION_ITEMS.add(alfalfaItem);
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(1, new EntityAIPanic(this, 2.0D));
    this.tasks.addTask(2, new EntityAIMate(this, 1.0D));
    this.tasks.addTask(3, new EntityAITempt(this, 1.25D, false, TEMPTATION_ITEMS));
    this.tasks.addTask(4, new EntityAIFollowParent(this, 1.25D));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 6.0F));
    this.tasks.addTask(7, new EntityAILookIdle(this));
}
Also used : Item(net.minecraft.item.Item) EntityAIWatchClosest(net.minecraft.entity.ai.EntityAIWatchClosest) EntityAIFollowParent(net.minecraft.entity.ai.EntityAIFollowParent) EntityAISwimming(net.minecraft.entity.ai.EntityAISwimming) EntityAITempt(net.minecraft.entity.ai.EntityAITempt) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityAIMate(net.minecraft.entity.ai.EntityAIMate) EntityAILookIdle(net.minecraft.entity.ai.EntityAILookIdle) EntityAIPanic(net.minecraft.entity.ai.EntityAIPanic) EntityAIWanderAvoidWater(net.minecraft.entity.ai.EntityAIWanderAvoidWater) Overwrite(org.spongepowered.asm.mixin.Overwrite)

Example 13 with EntityAIWanderAvoidWater

use of net.minecraft.entity.ai.EntityAIWanderAvoidWater in project DefiledLands by Lykrast.

the class EntityScuttler method initEntityAI.

@Override
protected void initEntityAI() {
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.5F));
    this.tasks.addTask(4, new EntityScuttler.AISpiderAttack(this));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, false));
    this.targetTasks.addTask(3, new EntityAINearestAttackableTarget<EntityIronGolem>(this, EntityIronGolem.class, false));
}
Also used : EntityAIWatchClosest(net.minecraft.entity.ai.EntityAIWatchClosest) EntityAILeapAtTarget(net.minecraft.entity.ai.EntityAILeapAtTarget) EntityAIHurtByTarget(net.minecraft.entity.ai.EntityAIHurtByTarget) EntityAILookIdle(net.minecraft.entity.ai.EntityAILookIdle) EntityIronGolem(net.minecraft.entity.monster.EntityIronGolem) EntityAISwimming(net.minecraft.entity.ai.EntityAISwimming) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityAIWanderAvoidWater(net.minecraft.entity.ai.EntityAIWanderAvoidWater)

Example 14 with EntityAIWanderAvoidWater

use of net.minecraft.entity.ai.EntityAIWanderAvoidWater in project DefiledLands by Lykrast.

the class EntityShamblerTwisted method initEntityAI.

@Override
protected void initEntityAI() {
    this.tasks.addTask(0, new EntityAISwimming(this));
    this.tasks.addTask(2, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIMoveTowardsRestriction(this, 1.0D));
    this.tasks.addTask(7, new EntityAIWanderAvoidWater(this, 1.0D));
    this.tasks.addTask(8, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(9, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
    this.targetTasks.addTask(2, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, false));
}
Also used : EntityAIWatchClosest(net.minecraft.entity.ai.EntityAIWatchClosest) EntityAIMoveTowardsRestriction(net.minecraft.entity.ai.EntityAIMoveTowardsRestriction) EntityAISwimming(net.minecraft.entity.ai.EntityAISwimming) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityAIHurtByTarget(net.minecraft.entity.ai.EntityAIHurtByTarget) EntityAILookIdle(net.minecraft.entity.ai.EntityAILookIdle) EntityAIAttackMelee(net.minecraft.entity.ai.EntityAIAttackMelee) EntityAIWanderAvoidWater(net.minecraft.entity.ai.EntityAIWanderAvoidWater)

Example 15 with EntityAIWanderAvoidWater

use of net.minecraft.entity.ai.EntityAIWanderAvoidWater in project DefiledLands by Lykrast.

the class EntityHost method initEntityAI.

protected void initEntityAI() {
    this.tasks.addTask(1, new EntityAISwimming(this));
    this.tasks.addTask(4, new EntityAIAttackMelee(this, 1.0D, false));
    this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
    this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
    this.tasks.addTask(6, new EntityAILookIdle(this));
    this.targetTasks.addTask(1, new EntityAINearestAttackableTarget<EntityPlayer>(this, EntityPlayer.class, true));
    this.targetTasks.addTask(2, new EntityAIHurtByTarget(this, false, new Class[0]));
}
Also used : EntityAIWatchClosest(net.minecraft.entity.ai.EntityAIWatchClosest) EntityAISwimming(net.minecraft.entity.ai.EntityAISwimming) EntityPlayer(net.minecraft.entity.player.EntityPlayer) EntityAIHurtByTarget(net.minecraft.entity.ai.EntityAIHurtByTarget) EntityAILookIdle(net.minecraft.entity.ai.EntityAILookIdle) EntityAIAttackMelee(net.minecraft.entity.ai.EntityAIAttackMelee) EntityAIWanderAvoidWater(net.minecraft.entity.ai.EntityAIWanderAvoidWater)

Aggregations

EntityAILookIdle (net.minecraft.entity.ai.EntityAILookIdle)15 EntityAISwimming (net.minecraft.entity.ai.EntityAISwimming)15 EntityAIWanderAvoidWater (net.minecraft.entity.ai.EntityAIWanderAvoidWater)15 EntityAIWatchClosest (net.minecraft.entity.ai.EntityAIWatchClosest)15 EntityPlayer (net.minecraft.entity.player.EntityPlayer)11 EntityAIHurtByTarget (net.minecraft.entity.ai.EntityAIHurtByTarget)6 EntityAIMoveTowardsRestriction (net.minecraft.entity.ai.EntityAIMoveTowardsRestriction)6 EntityAIAttackMelee (net.minecraft.entity.ai.EntityAIAttackMelee)5 EntityAIFollowParent (net.minecraft.entity.ai.EntityAIFollowParent)4 EntityAIMate (net.minecraft.entity.ai.EntityAIMate)4 EntityAIPanic (net.minecraft.entity.ai.EntityAIPanic)4 EntityAITempt (net.minecraft.entity.ai.EntityAITempt)4 EntityMob (net.minecraft.entity.monster.EntityMob)4 Item (net.minecraft.item.Item)3 Overwrite (org.spongepowered.asm.mixin.Overwrite)3 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 EntityAILeapAtTarget (net.minecraft.entity.ai.EntityAILeapAtTarget)2 EntityAIZombieAttack (net.minecraft.entity.ai.EntityAIZombieAttack)2 EntityAIRestrictSun (net.minecraft.entity.ai.EntityAIRestrictSun)1 EntityIronGolem (net.minecraft.entity.monster.EntityIronGolem)1