Search in sources :

Example 6 with LookAtGoal

use of net.minecraft.entity.ai.goal.LookAtGoal in project minecolonies by ldtteam.

the class VisitorCitizen method initTasks.

private void initTasks() {
    int priority = 0;
    this.goalSelector.addGoal(priority, new SwimGoal(this));
    this.goalSelector.addGoal(++priority, new OpenDoorGoal(this, true));
    this.goalSelector.addGoal(priority, new EntityAIInteractToggleAble(this, FENCE_TOGGLE, TRAP_TOGGLE, DOOR_TOGGLE));
    this.goalSelector.addGoal(++priority, new LookAtWithoutMovingGoal(this, PlayerEntity.class, WATCH_CLOSEST2, 1.0F));
    this.goalSelector.addGoal(++priority, new LookAtWithoutMovingGoal(this, EntityCitizen.class, WATCH_CLOSEST2_FAR, WATCH_CLOSEST2_FAR_CHANCE));
    this.goalSelector.addGoal(++priority, new LookAtGoal(this, LivingEntity.class, WATCH_CLOSEST));
    this.goalSelector.addGoal(++priority, new EntityAIVisitor(this));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) EntityAIInteractToggleAble(com.minecolonies.coremod.entity.ai.minimal.EntityAIInteractToggleAble) EntityAIVisitor(com.minecolonies.coremod.entity.ai.minimal.EntityAIVisitor) LookAtWithoutMovingGoal(net.minecraft.entity.ai.goal.LookAtWithoutMovingGoal) OpenDoorGoal(net.minecraft.entity.ai.goal.OpenDoorGoal) AbstractEntityCitizen(com.minecolonies.api.entity.citizen.AbstractEntityCitizen) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity)

Example 7 with LookAtGoal

use of net.minecraft.entity.ai.goal.LookAtGoal in project ChaosAwakens by ChaosAwakens.

the class SparkFishEntity method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(0, new PanicGoal(this, 1.05D));
    this.goalSelector.addGoal(0, new LookAtGoal(this, PlayerEntity.class, 3.0F, 3.0F));
    this.goalSelector.addGoal(2, new AvoidEntityGoal<>(this, PlayerEntity.class, 4.0F, 0.8D, 0.7D, EntityPredicates.NO_SPECTATORS::test));
    this.goalSelector.addGoal(4, new SparkFishEntity.SwimGoal(this));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) PanicGoal(net.minecraft.entity.ai.goal.PanicGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity)

Example 8 with LookAtGoal

use of net.minecraft.entity.ai.goal.LookAtGoal in project ChaosAwakens by ChaosAwakens.

the class RoboEntity method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(4, new LookAtGoal(this, PlayerEntity.class, 32.0F));
    this.goalSelector.addGoal(4, new LookAtGoal(this, IronGolemEntity.class, 32.0F));
    this.goalSelector.addGoal(4, new LookAtGoal(this, SnowGolemEntity.class, 32.0F));
    this.goalSelector.addGoal(3, new LookAtGoal(this, AbstractVillagerEntity.class, 32.0F));
    this.goalSelector.addGoal(4, new LookAtGoal(this, AnimalEntity.class, 32.0F));
    this.targetSelector.addGoal(5, new HurtByTargetGoal(this));
    this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
    this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, IronGolemEntity.class, true));
    this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, SnowGolemEntity.class, true));
    this.targetSelector.addGoal(3, new NearestAttackableTargetGoal<>(this, AbstractVillagerEntity.class, true));
    this.targetSelector.addGoal(4, new NearestAttackableTargetGoal<>(this, AnimalEntity.class, true));
}
Also used : AbstractVillagerEntity(net.minecraft.entity.merchant.villager.AbstractVillagerEntity) LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) SnowGolemEntity(net.minecraft.entity.passive.SnowGolemEntity) AnimalEntity(net.minecraft.entity.passive.AnimalEntity) IronGolemEntity(net.minecraft.entity.passive.IronGolemEntity) HurtByTargetGoal(net.minecraft.entity.ai.goal.HurtByTargetGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 9 with LookAtGoal

use of net.minecraft.entity.ai.goal.LookAtGoal in project minecolonies by Minecolonies.

the class VisitorCitizen method initTasks.

private void initTasks() {
    int priority = 0;
    this.goalSelector.addGoal(priority, new SwimGoal(this));
    this.goalSelector.addGoal(++priority, new OpenDoorGoal(this, true));
    this.goalSelector.addGoal(priority, new EntityAIInteractToggleAble(this, FENCE_TOGGLE, TRAP_TOGGLE, DOOR_TOGGLE));
    this.goalSelector.addGoal(++priority, new LookAtWithoutMovingGoal(this, PlayerEntity.class, WATCH_CLOSEST2, 1.0F));
    this.goalSelector.addGoal(++priority, new LookAtWithoutMovingGoal(this, EntityCitizen.class, WATCH_CLOSEST2_FAR, WATCH_CLOSEST2_FAR_CHANCE));
    this.goalSelector.addGoal(++priority, new LookAtGoal(this, LivingEntity.class, WATCH_CLOSEST));
    this.goalSelector.addGoal(++priority, new EntityAIVisitor(this));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) EntityAIInteractToggleAble(com.minecolonies.coremod.entity.ai.minimal.EntityAIInteractToggleAble) EntityAIVisitor(com.minecolonies.coremod.entity.ai.minimal.EntityAIVisitor) LookAtWithoutMovingGoal(net.minecraft.entity.ai.goal.LookAtWithoutMovingGoal) OpenDoorGoal(net.minecraft.entity.ai.goal.OpenDoorGoal) AbstractEntityCitizen(com.minecolonies.api.entity.citizen.AbstractEntityCitizen) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity)

Example 10 with LookAtGoal

use of net.minecraft.entity.ai.goal.LookAtGoal in project bioplethora by AquexTheSeal.

the class CavernFleignarEntity method registerGoals.

@Override
protected void registerGoals() {
    super.registerGoals();
    this.goalSelector.addGoal(3, new LookAtGoal(this, PlayerEntity.class, 24.0F));
    this.goalSelector.addGoal(2, new CavernFleignarMeleeGoal(this, 20, 0.8, 0.9));
    this.goalSelector.addGoal(5, new LookRandomlyGoal(this));
    this.targetSelector.addGoal(2, new CavernFleignarTargetGoal(this, true));
    this.targetSelector.addGoal(1, new HurtByTargetGoal(this).setAlertOthers(this.getClass()));
}
Also used : CavernFleignarTargetGoal(io.github.bioplethora.entity.ai.CavernFleignarTargetGoal) LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) LookRandomlyGoal(net.minecraft.entity.ai.goal.LookRandomlyGoal) HurtByTargetGoal(net.minecraft.entity.ai.goal.HurtByTargetGoal) CavernFleignarMeleeGoal(io.github.bioplethora.entity.ai.CavernFleignarMeleeGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Aggregations

LookAtGoal (net.minecraft.entity.ai.goal.LookAtGoal)13 PlayerEntity (net.minecraft.entity.player.PlayerEntity)13 SwimGoal (net.minecraft.entity.ai.goal.SwimGoal)7 ServerPlayerEntity (net.minecraft.entity.player.ServerPlayerEntity)7 AbstractEntityCitizen (com.minecolonies.api.entity.citizen.AbstractEntityCitizen)4 EntityAIInteractToggleAble (com.minecolonies.coremod.entity.ai.minimal.EntityAIInteractToggleAble)4 LookAtWithoutMovingGoal (net.minecraft.entity.ai.goal.LookAtWithoutMovingGoal)4 LookRandomlyGoal (net.minecraft.entity.ai.goal.LookRandomlyGoal)4 PanicGoal (net.minecraft.entity.ai.goal.PanicGoal)3 EntityAIVisitor (com.minecolonies.coremod.entity.ai.minimal.EntityAIVisitor)2 HurtByTargetGoal (net.minecraft.entity.ai.goal.HurtByTargetGoal)2 OpenDoorGoal (net.minecraft.entity.ai.goal.OpenDoorGoal)2 MonsterEntity (net.minecraft.entity.monster.MonsterEntity)2 CavernFleignarMeleeGoal (io.github.bioplethora.entity.ai.CavernFleignarMeleeGoal)1 CavernFleignarTargetGoal (io.github.bioplethora.entity.ai.CavernFleignarTargetGoal)1 RobitAIFollow (mekanism.common.entity.ai.RobitAIFollow)1 RobitAIPickup (mekanism.common.entity.ai.RobitAIPickup)1 RandomWalkingGoal (net.minecraft.entity.ai.goal.RandomWalkingGoal)1 WaterAvoidingRandomWalkingGoal (net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal)1 AbstractVillagerEntity (net.minecraft.entity.merchant.villager.AbstractVillagerEntity)1