Search in sources :

Example 1 with LookAtGoal

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

the class EntityCitizen method initTasks.

/**
 * Initiates citizen goalSelector Suppressing Sonar Rule Squid:S881 The rule thinks we should extract ++priority in a proper statement. But in this case the rule does not apply
 * because that would remove the readability.
 */
@SuppressWarnings(INCREMENT_AND_DECREMENT_OPERATORS_SHOULD_NOT_BE_USED_IN_A_METHOD_CALL_OR_MIXED_WITH_OTHER_OPERATORS_IN_AN_EXPRESSION)
private void initTasks() {
    int priority = 0;
    this.goalSelector.addGoal(priority, new SwimGoal(this));
    this.goalSelector.addGoal(++priority, new EntityAICitizenAvoidEntity(this, MonsterEntity.class, (float) DISTANCE_OF_ENTITY_AVOID, LATER_RUN_SPEED_AVOID, INITIAL_RUN_SPEED_AVOID));
    this.goalSelector.addGoal(++priority, new EntityAIEatTask(this));
    this.goalSelector.addGoal(++priority, new EntityAISickTask(this));
    this.goalSelector.addGoal(++priority, new EntityAISleep(this));
    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 EntityAICitizenWander(this, DEFAULT_SPEED, 1.0D));
    this.goalSelector.addGoal(++priority, new LookAtGoal(this, LivingEntity.class, WATCH_CLOSEST));
    this.goalSelector.addGoal(++priority, new EntityAIMournCitizen(this, DEFAULT_SPEED));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) EntityAIInteractToggleAble(com.minecolonies.coremod.entity.ai.minimal.EntityAIInteractToggleAble) MonsterEntity(net.minecraft.entity.monster.MonsterEntity) LookAtWithoutMovingGoal(net.minecraft.entity.ai.goal.LookAtWithoutMovingGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity) AbstractEntityCitizen(com.minecolonies.api.entity.citizen.AbstractEntityCitizen)

Example 2 with LookAtGoal

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

the class EntityRobit method registerGoals.

@Override
protected void registerGoals() {
    super.registerGoals();
    goalSelector.addGoal(1, new RobitAIPickup(this, 1));
    goalSelector.addGoal(2, new RobitAIFollow(this, 1, 4, 2));
    goalSelector.addGoal(3, new LookAtGoal(this, PlayerEntity.class, 8));
    goalSelector.addGoal(3, new LookRandomlyGoal(this));
    goalSelector.addGoal(4, new SwimGoal(this));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) LookRandomlyGoal(net.minecraft.entity.ai.goal.LookRandomlyGoal) RobitAIFollow(mekanism.common.entity.ai.RobitAIFollow) RobitAIPickup(mekanism.common.entity.ai.RobitAIPickup) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity)

Example 3 with LookAtGoal

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

the class TelemreyeEntity method registerGoals.

@Override
protected void registerGoals() {
    super.registerGoals();
    this.goalSelector.addGoal(3, new LookAtGoal(this, PlayerEntity.class, 24.0F));
    this.goalSelector.addGoal(1, new TelemreyeEntity.PickAttackGoal());
    this.goalSelector.addGoal(2, new TelemreyeEntity.SweepAttackGoal());
    this.goalSelector.addGoal(3, new TelemreyeEntity.OrbitPointGoal());
    this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, AlphemEntity.class, true));
    this.targetSelector.addGoal(1, new NearestAttackableTargetGoal<>(this, PlayerEntity.class, true));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 4 with LookAtGoal

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

the class EntityCQRMountBase method registerGoals.

@Override
protected void registerGoals() {
    this.goalSelector.addGoal(0, new SwimGoal(this));
    this.goalSelector.addGoal(1, new PanicGoal(this, 0.9D));
    this.goalSelector.addGoal(6, new WaterAvoidingRandomWalkingGoal(this, 0.6D));
    this.goalSelector.addGoal(7, new LookAtGoal(this, PlayerEntity.class, 6.0F));
    this.goalSelector.addGoal(8, new LookRandomlyGoal(this));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) LookRandomlyGoal(net.minecraft.entity.ai.goal.LookRandomlyGoal) WaterAvoidingRandomWalkingGoal(net.minecraft.entity.ai.goal.WaterAvoidingRandomWalkingGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PanicGoal(net.minecraft.entity.ai.goal.PanicGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity)

Example 5 with LookAtGoal

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

the class EntityCitizen method initTasks.

/**
 * Initiates citizen goalSelector Suppressing Sonar Rule Squid:S881 The rule thinks we should extract ++priority in a proper statement. But in this case the rule does not apply
 * because that would remove the readability.
 */
@SuppressWarnings(INCREMENT_AND_DECREMENT_OPERATORS_SHOULD_NOT_BE_USED_IN_A_METHOD_CALL_OR_MIXED_WITH_OTHER_OPERATORS_IN_AN_EXPRESSION)
private void initTasks() {
    int priority = 0;
    this.goalSelector.addGoal(priority, new SwimGoal(this));
    this.goalSelector.addGoal(++priority, new EntityAICitizenAvoidEntity(this, MonsterEntity.class, (float) DISTANCE_OF_ENTITY_AVOID, LATER_RUN_SPEED_AVOID, INITIAL_RUN_SPEED_AVOID));
    this.goalSelector.addGoal(++priority, new EntityAIEatTask(this));
    this.goalSelector.addGoal(++priority, new EntityAISickTask(this));
    this.goalSelector.addGoal(++priority, new EntityAISleep(this));
    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 EntityAICitizenWander(this, DEFAULT_SPEED, 1.0D));
    this.goalSelector.addGoal(++priority, new LookAtGoal(this, LivingEntity.class, WATCH_CLOSEST));
    this.goalSelector.addGoal(++priority, new EntityAIMournCitizen(this, DEFAULT_SPEED));
}
Also used : LookAtGoal(net.minecraft.entity.ai.goal.LookAtGoal) EntityAIInteractToggleAble(com.minecolonies.coremod.entity.ai.minimal.EntityAIInteractToggleAble) MonsterEntity(net.minecraft.entity.monster.MonsterEntity) LookAtWithoutMovingGoal(net.minecraft.entity.ai.goal.LookAtWithoutMovingGoal) SwimGoal(net.minecraft.entity.ai.goal.SwimGoal) PlayerEntity(net.minecraft.entity.player.PlayerEntity) ServerPlayerEntity(net.minecraft.entity.player.ServerPlayerEntity) AbstractEntityCitizen(com.minecolonies.api.entity.citizen.AbstractEntityCitizen)

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