use of net.minecraft.world.entity.ai.goal.TemptGoal in project Totemic by TeamTotemic.
the class InfusedFluteItem method temptEntities.
private void temptEntities(Level world, double x, double y, double z) {
TotemicEntityUtil.getEntitiesInRange(Mob.class, world, new BlockPos(x, y, z), 2, 2, entity -> ((entity instanceof Animal && entity.getNavigation() instanceof GroundPathNavigation) || entity instanceof Villager) && !temptedEntities.contains(entity)).forEach(entity -> {
double speed = (entity instanceof Animal) ? 1 : 0.5;
entity.goalSelector.addGoal(5, new TemptGoal((PathfinderMob) entity, speed, Ingredient.of(this), false));
temptedEntities.add(entity);
});
}
use of net.minecraft.world.entity.ai.goal.TemptGoal in project Tropicraft by Tropicraft.
the class TapirEntity method registerGoals.
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25, BREEDING_ITEMS.get(), false));
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25));
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
}
use of net.minecraft.world.entity.ai.goal.TemptGoal in project Tropicraft by Tropicraft.
the class WhiteLippedPeccaryEntity method registerGoals.
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25, BREEDING_ITEMS.get(), false));
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25));
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
}
use of net.minecraft.world.entity.ai.goal.TemptGoal in project Tropicraft by Tropicraft.
the class HummingbirdEntity method registerGoals.
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new FlyAwayInPanicGoal());
this.goalSelector.addGoal(2, new TemptGoal(this, 1.25, Ingredient.of(Items.SUGAR), false));
this.goalSelector.addGoal(3, new LookAtPlayerGoal(this, Player.class, 8.0F));
this.goalSelector.addGoal(4, new FeedFromPlantsGoal());
this.goalSelector.addGoal(5, new FlyAroundRandomlyGoal());
}
use of net.minecraft.world.entity.ai.goal.TemptGoal in project Tropicraft by Tropicraft.
the class SpiderMonkeyEntity method registerGoals.
@Override
protected void registerGoals() {
this.goalSelector.addGoal(0, new FloatGoal(this));
this.goalSelector.addGoal(1, new PanicGoal(this, 2.0));
this.goalSelector.addGoal(2, new BreedGoal(this, 1.0));
this.goalSelector.addGoal(3, new TemptGoal(this, 1.25, BREEDING_ITEMS.get(), false));
this.goalSelector.addGoal(4, new FollowParentGoal(this, 1.25));
this.goalSelector.addGoal(5, new WaterAvoidingRandomStrollGoal(this, 1.0));
this.goalSelector.addGoal(6, new LookAtPlayerGoal(this, Player.class, 6.0F));
this.goalSelector.addGoal(7, new RandomLookAroundGoal(this));
}
Aggregations