use of net.minecraft.entity.ai.goal.SwimGoal 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));
}
use of net.minecraft.entity.ai.goal.SwimGoal 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));
}
use of net.minecraft.entity.ai.goal.SwimGoal in project beebuddy by queenofthebees.
the class BeeEntityMixin method beebuddy$initTamedGoals.
@Unique
private void beebuddy$initTamedGoals() {
BeeEntity us = (BeeEntity) (Object) this;
this.goalSelector.add(0, new BeeSitGoal(us));
this.goalSelector.add(1, StingGoalInvoker.beebuddy$make(us, us, 1.399999976158142D, true));
this.goalSelector.add(2, new FollowParentGoal(us, 1.25D));
this.goalSelector.add(3, new FollowFriendGoal(us));
this.goalSelector.add(4, new AnimalMateGoal(us, 1.0D));
if (pollinateGoal == null) {
// we can be called before initGoals's body
pollinateGoal = PollinateGoalInvoker.beebuddy$make(us);
}
this.goalSelector.add(5, pollinateGoal);
if (moveToFlowerGoal == null) {
moveToFlowerGoal = MoveToFlowerGoalInvoker.beebuddy$make(us);
}
this.goalSelector.add(6, moveToFlowerGoal);
this.goalSelector.add(7, new SitOnHeadGoal(us));
this.goalSelector.add(7, BeeWanderAroundGoalInvoker.beebuddy$make(us));
this.goalSelector.add(8, new LookAtEntityGoal(us, PlayerEntity.class, 4.0F));
this.goalSelector.add(8, new SwimGoal(us));
BeeEntityMixin mix = this;
this.targetSelector.add(1, (new RevengeGoal(this) {
@Override
public boolean canStart() {
if (!super.canStart()) {
return false;
}
if (us.getAttacker() != null) {
UUID u = us.getAttacker().getUuid();
return !u.equals(mix.beebuddy$getFriend());
} else {
return true;
}
}
@Override
public boolean shouldContinue() {
return us.hasAngerTime() && super.shouldContinue();
}
}).setGroupRevenge(new Class[0]));
}
use of net.minecraft.entity.ai.goal.SwimGoal in project bioplethora by AquexTheSeal.
the class PrimordialRingEntity method registerGoals.
@Override
protected void registerGoals() {
super.registerGoals();
this.goalSelector.addGoal(1, new PrimordialRingFollowOwnerGoal(this, 1.5D, 30.0F, 5.0F, true));
this.goalSelector.addGoal(2, new PrimordialRingRangedAttackGoal(this));
this.goalSelector.addGoal(5, new LookRandomlyGoal(this));
this.goalSelector.addGoal(7, new SwimGoal(this));
this.targetSelector.addGoal(1, new PrimordialRingOwnerHurtByTargetGoal(this));
this.targetSelector.addGoal(2, new PrimordialRingOwnerHurtTargetGoal(this));
}
use of net.minecraft.entity.ai.goal.SwimGoal in project wildmod by Osmiooo.
the class FireflyEntity method initGoals.
protected void initGoals() {
this.goalSelector.add(2, new FireflyWanderGoal(this));
this.goalSelector.add(1, new SwimGoal(this));
}
Aggregations